Comparing version 0.0.5 to 0.0.6
@@ -33,3 +33,10 @@ var api = require('./api') | ||
} else { | ||
res.redirect('/status') | ||
api.getEventList(function(err, eventList) { | ||
if (err) return next(err) | ||
var fail = 0 | ||
eventList.forEach(function(e) { | ||
fail += e.fail | ||
}) | ||
res.render('index.html', { fail: fail, ok: !fail }) | ||
}) | ||
} | ||
@@ -36,0 +43,0 @@ }) |
@@ -14,5 +14,7 @@ var async = require('async') | ||
exports.setupRedis = function(options, cb) { | ||
exports.redis.on('error', function(err) { | ||
var redis = exports.redis | ||
redis.on('error', function(err) { | ||
if (!err) return | ||
util.log(err) | ||
util.log('redis: ' + err.message) | ||
if (cb) return cb(err) | ||
@@ -22,4 +24,4 @@ process.exit(1) | ||
exports.redis.on('connect', function() { | ||
exports.redis.select(options.redis.database, function() { | ||
redis.on('connect', function() { | ||
redis.select(options.redis.database, function() { | ||
// handle something? | ||
@@ -35,2 +37,11 @@ }) | ||
sql.on('error', function(err) { | ||
util.log('sql: ' + err.message + (err.code ? ' (' + err.code + ')' : '')) | ||
if (!err.fatal) return | ||
if (err.code != 'PROTOCOL_CONNECTION_LOST') throw err | ||
util.log('sql: reconnecting to database') | ||
exports.sql = mysql.createConnection(options.mysql) | ||
exports.setupSql(options) | ||
}) | ||
async.series([ | ||
@@ -51,3 +62,3 @@ function(cb) { sql.query('USE ' + options.mysql.database, cb) }, | ||
if (cb) return cb(err) | ||
util.log(err) | ||
util.log('sql: ' + err.message) | ||
process.exit(1) | ||
@@ -69,3 +80,2 @@ } else { | ||
api.getSuiteResultList({ suite_result_id: id }, function(err, suiteResultList) { | ||
@@ -72,0 +82,0 @@ if (err || !suiteResultList.length) return |
{ | ||
"name": "ntfserver", | ||
"description": "Network Testing Framework Server", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"author": "Silas Sewell <silas@sewell.org>", | ||
@@ -10,3 +10,3 @@ "engines": { "node": ">= 0.6" }, | ||
"express": ">= 2.4.7; < 2.6", | ||
"mysql": ">= 0.9.5", | ||
"mysql": ">= 2.0.0-alpha5", | ||
"redis": ">= 0.6.7", | ||
@@ -13,0 +13,0 @@ "setting": ">= 0.1.0", |
Sorry, the diff of this file is not supported yet
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
Non-existent author
Supply chain riskThe package was published by an npm account that no longer exists.
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
86049
48
2211
2
Updatedmysql@>= 2.0.0-alpha5