Comparing version 0.2.4 to 0.2.5
24
index.js
@@ -99,18 +99,16 @@ module.exports = Statware | ||
var self = this | ||
var defaultCallback = function (err, res) { | ||
if (err) { | ||
console.log("Unable to push stats.", err) | ||
return | ||
} | ||
if (res.statusCode >= 400) { | ||
console.log("Unable to push stats. Server reported %s", res.statusCode) | ||
return | ||
} | ||
} | ||
self.push = function (cb) { | ||
if (!cb) { | ||
cb = function (err, res) { | ||
if (err) { | ||
console.log("Unable to push stats.", err) | ||
return | ||
} | ||
if (res.statusCode >= 400) { | ||
console.log("Unable to push stats. Server reported %s", res.statusCode) | ||
return | ||
} | ||
} | ||
} | ||
self.stats.getStats(function (stats) { | ||
options.body = stats | ||
request.post(options, cb) | ||
request.post(options, cb || defaultCallback) | ||
}) | ||
@@ -117,0 +115,0 @@ } |
{ | ||
"name": "statware", | ||
"description": "Status aggregation suite with middle-ware like abilities. Used by the Ravenwall agent.", | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"author": "Bryce B. Baril <bryce@ravenwall.com>", | ||
@@ -6,0 +6,0 @@ "dependencies": { |
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
18343
9
542
12