Better error checking for invalid markets
This commit is contained in:
+12
-9
@@ -28,15 +28,18 @@ db.connect(dbString, function() {
|
||||
// check markets
|
||||
var markets = settings.markets.enabled;
|
||||
for (var i = 0; i < markets.length; i++) {
|
||||
db.check_market(markets[i], function(market, exists) {
|
||||
if(exists == false) {
|
||||
console.log('no %s entry found, creating now..', market);
|
||||
db.create_market(settings.markets.coin, settings.markets.exchange, market, function(){
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// check if market is installed
|
||||
if (db.fs.existsSync('./lib/markets/' + markets[i] + '.js')) {
|
||||
db.check_market(markets[i], function(market, exists) {
|
||||
if (exists == false) {
|
||||
console.log('no %s entry found, creating now..', market);
|
||||
db.create_market(settings.markets.coin, settings.markets.exchange, market, function() {
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
db.check_richlist(settings.coin, function(exists){
|
||||
if (exists == false) {
|
||||
console.log('no richlist entry found, creating now..');
|
||||
|
||||
Reference in New Issue
Block a user