style(jshint): some style fixes and jshint compatibility improved
This commit is contained in:
parent
56315ffd34
commit
6b004fdf8e
4 changed files with 21 additions and 22 deletions
|
|
@ -1,8 +1,10 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
'use strict';
|
||||
|
||||
var fs = require('fs');
|
||||
var createServer = require('../lib/app.js');
|
||||
var argv = require('minimist')(process.argv.slice(2));
|
||||
var logger = require('../lib/logger');
|
||||
|
||||
var options = {
|
||||
postgres: process.env.DATABASE_URL
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
'use strict';
|
||||
|
||||
var bunyan = require('bunyan');
|
||||
var async = require('async');
|
||||
|
||||
|
|
@ -10,25 +12,26 @@ var bunyan = bunyan.createLogger({name: 'lamassu-server', level: logLevel});
|
|||
|
||||
// log version
|
||||
var version = require('../package.json').version;
|
||||
bunyan.info('Version:', version);
|
||||
bunyan.info('Version: %s', version);
|
||||
|
||||
|
||||
// log twitter stuff (optional)
|
||||
function wrapper(fn) {
|
||||
return function(cb) {
|
||||
fn(function(value) {
|
||||
cb(null, value);
|
||||
});
|
||||
}
|
||||
// log git stuff (optional)
|
||||
// `git-rev` omits `err` param in callback, without this wrapper
|
||||
// `async` interprets returned values as errors.
|
||||
function wrapper(fn, cb) {
|
||||
fn(function(value) {
|
||||
cb(null, value);
|
||||
});
|
||||
}
|
||||
try {
|
||||
var git = require('git-rev');
|
||||
|
||||
async.parallel([
|
||||
wrapper(git.branch),
|
||||
wrapper(git.short)
|
||||
async.apply(wrapper, git.branch),
|
||||
async.apply(wrapper, git.short)
|
||||
],
|
||||
function(err, values) {
|
||||
bunyan.info('Git:', '#' + values[0], '@' + values[1]);
|
||||
bunyan.info('Git: #%s @%s', values[0], values[1]);
|
||||
});
|
||||
} catch(_) {}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,12 +17,7 @@ var traderPlugin = null;
|
|||
var walletPlugin = null;
|
||||
var idVerifierPlugin = null;
|
||||
|
||||
var currentlyUsedPlugins = {
|
||||
ticker: null,
|
||||
transfer: null,
|
||||
trader: null,
|
||||
idVerifier: null
|
||||
};
|
||||
var currentlyUsedPlugins = {};
|
||||
|
||||
|
||||
var cachedConfig = null;
|
||||
|
|
@ -135,7 +130,7 @@ exports.configure = function configure(config) {
|
|||
tickerPlugin,
|
||||
'ticker',
|
||||
deviceCurrency, // device currency
|
||||
function onTickerChange(newTicker, currency) {
|
||||
function onTickerChange(newTicker) {
|
||||
tickerPlugin = newTicker;
|
||||
pollRate();
|
||||
}
|
||||
|
|
@ -335,7 +330,7 @@ function pollBalance(callback) {
|
|||
}
|
||||
|
||||
function pollRate(callback) {
|
||||
logger.debug('polling for rates (' + tickerPlugin.NAME + ')');
|
||||
logger.debug('polling for rates (%s)', tickerPlugin.NAME);
|
||||
|
||||
tickerPlugin.ticker(deviceCurrency, function(err, resRates) {
|
||||
if (err) {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ var mock = false;
|
|||
|
||||
var plugins;
|
||||
var lamassuConfig;
|
||||
var config;
|
||||
|
||||
module.exports = {
|
||||
init: init,
|
||||
|
|
@ -58,7 +57,7 @@ function poll(req, res) {
|
|||
};
|
||||
|
||||
if (response.idVerificationEnabled)
|
||||
response.idVerificationLimit = complianceSettings.idVerificationLimit
|
||||
response.idVerificationLimit = complianceSettings.idVerificationLimit;
|
||||
|
||||
res.json(response);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue