Skip to content

Commit

Permalink
metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
generalhenry committed Jan 16, 2014
1 parent 59e028f commit 76fd980
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,5 @@
"maxparams" : 8, // dang
"maxdepth" : 2,
"maxstatements" : 11, // this needs to be brought down
"maxcomplexity" : 10 // this also needs to come down
"maxcomplexity" : 9 // this also needs to come down
}
2 changes: 1 addition & 1 deletion configs/testing.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"harbourmaster": "http://localhost:3033",
"runnable_access_timeout": "5 seconds",
"logExpress": false,
"logErrorStack": true,
"logErrorStack": false,
"throwErrors": true,
"adminToken": "e6f5a32a-4be0-4d84-91cb-782c65ae320f",
"cleanInterval": "2 minutes",
Expand Down
11 changes: 7 additions & 4 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,17 @@ App.prototype.create = function () {
this.server = http.createServer(app);
return this.server;
function errorMiddleware (err, req, res, next) {
if (configs.logErrorStack && false) {
console.log(err.stack);
}
errorHandler(err);
res.json(err.code || 500, {
message: err.msg || 'something bad happened :(',
error: err.message,
stack: configs.logErrorStack ? err.stack : undefined
stack: configs.throwErrors ? err.stack : undefined
});
}
function errorHandler (err) {
if (configs.logErrorStack) {
console.error(err.stack);
}
if (err.code === 500 || err.code === undefined) {
self.stop(function () {
self.cleanup();
Expand Down
6 changes: 3 additions & 3 deletions lib/rest/impexp.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ app.get('/runnables/:id/export', function (req, res) {
runnable_json.files = [];
async.forEach(files, function (file, cb) {
if (file.ignore || file['default']) {
file.ignore = file.ignore || false;
file.dir = file.dir || false;
file['default'] = file['default'] || false;
file.ignore = !!file.ignore;
file.dir = !!file.dir;
file['default'] = !!file['default'];
runnable_json.files.push({
name: file.name,
path: file.path,
Expand Down
5 changes: 1 addition & 4 deletions lib/rest/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,7 @@ var getusers = function (req, res, next) {
res.json(users);
});
if (req.query.ids) {
var userIds = req.query.ids || [];
if (!Array.isArray(userIds)) {
userIds = [userIds];
}
var userIds = [].concat(req.query.ids);
users.publicListWithIds(req.domain, userIds, sendUsers);
} else if (req.query.username) {
users.publicList(req.domain, { lower_username: req.query.username.toLowerCase() }, sendUsers);
Expand Down

0 comments on commit 76fd980

Please sign in to comment.