Skip to content
This repository has been archived by the owner on May 7, 2024. It is now read-only.

Commit

Permalink
Check if there are any existing upstreams before trying to find upstr…
Browse files Browse the repository at this point in the history
…eam alerts. This fixes the SQL error referenced @ issues #288 and #122#issuecomment-451294182
  • Loading branch information
pantsel committed Jan 3, 2019
1 parent a5ee37b commit 068e3ab
Show file tree
Hide file tree
Showing 3 changed files with 217 additions and 213 deletions.
4 changes: 4 additions & 0 deletions api/services/KongProxyHooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ var self = module.exports = {
const existingUpstreamIds = _.map(resBody.data, item => item.id);
sails.log("KongProxyHooks:upstreams:afterList:existingUpstreamIds", existingUpstreamIds);

if(!existingUpstreamIds.length) {
return next();
}

// Check if there are any alerts that do not match
// the exiting upstream ids
sails.models.upstreamalert.find({
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kongadmin",
"version": "0.14.1-rc10",
"version": "0.14.1-rc11",
"description": "Kong admin GUI",
"keywords": [
"sails.js",
Expand Down
Loading

0 comments on commit 068e3ab

Please sign in to comment.