btrz-health-check
Advanced tools
Comparing version 2.3.0 to 3.0.0
{ | ||
"name": "btrz-health-check", | ||
"version": "2.3.0", | ||
"version": "3.0.0", | ||
"description": "A series of classes that will ping different service types to verify accessibility.", | ||
@@ -35,10 +35,10 @@ "main": "index.js", | ||
"devDependencies": { | ||
"chai": "4.3.6", | ||
"mocha": "10.0.0", | ||
"sinon": "14.0.0" | ||
"chai": "4.3.7", | ||
"mocha": "10.2.0", | ||
"sinon": "15.0.4" | ||
}, | ||
"dependencies": { | ||
"superagent": "8.0.0", | ||
"superagent": "8.0.9", | ||
"git-rev": "^0.2.1" | ||
} | ||
} |
@@ -1,5 +0,2 @@ | ||
"use strict"; | ||
let ServiceStatus = require("./service-status").ServiceStatus; | ||
class SQSHealthChecker { | ||
@@ -16,13 +13,9 @@ constructor(queue, options) { | ||
let self = this; | ||
function resolver(resolve, reject) { | ||
self.queue.listQueues(function (err, result) { | ||
if (err) { | ||
reject(self.serviceStatus.fails(err)); | ||
} | ||
if (result) { | ||
resolve(self.serviceStatus.success()); | ||
} | ||
return self.queue.listQueues({}) | ||
.then(() => { | ||
return self.serviceStatus.success(); | ||
}) | ||
.catch((err) => { | ||
return Promise.reject(self.serviceStatus.fails(err)); | ||
}); | ||
} | ||
return new Promise(resolver); | ||
} | ||
@@ -29,0 +22,0 @@ } |
@@ -5,3 +5,3 @@ "use strict"; | ||
let SQSHealthChecker = require("../src/sqs-health-checker").SQSHealthChecker, | ||
sqs = {listQueues: function (cb) {cb(null, []); }}, | ||
sqs = {listQueues: function () { return Promise.resolve();}}, | ||
expect = require("chai").expect; | ||
@@ -43,4 +43,4 @@ | ||
let sqs = | ||
{listQueues: function (cb) { | ||
cb(new Error()); | ||
{listQueues: function () { | ||
return Promise.reject(); | ||
} | ||
@@ -58,4 +58,4 @@ }; | ||
let sqs = | ||
{listQueues: function (cb) { | ||
cb(new Error()); | ||
{listQueues: function () { | ||
return Promise.reject(); | ||
} | ||
@@ -79,4 +79,4 @@ }, | ||
let sqs = | ||
{listQueues: function (cb) { | ||
cb(new Error()); | ||
{listQueues: function () { | ||
return Promise.reject(); | ||
} | ||
@@ -83,0 +83,0 @@ }; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28834
660
+ Addedsuperagent@8.0.9(transitive)
- Removedinherits@2.0.4(transitive)
- Removedreadable-stream@3.6.2(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedstring_decoder@1.3.0(transitive)
- Removedsuperagent@8.0.0(transitive)
- Removedutil-deprecate@1.0.2(transitive)
Updatedsuperagent@8.0.9