forked from GitHub/dbot
only save the db to disk every minute
This commit is contained in:
parent
36496b64ac
commit
5f8cbe3fb1
@ -51,6 +51,10 @@ var admin = function(dbot) {
|
|||||||
fs.writeFileSync('config.json', JSON.stringify(config, null, ' '));
|
fs.writeFileSync('config.json', JSON.stringify(config, null, ' '));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.onLoad = function() {
|
||||||
|
dbot.api.timers.addTimer(60000, dbot.save);
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.fetch = function(dbot) {
|
exports.fetch = function(dbot) {
|
||||||
|
@ -101,7 +101,6 @@ var command = function(dbot) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!_.include(['reload', 'load', 'unload', 'setconfig'], commandName)) dbot.api.event.emit('command', [ event ]);
|
if(!_.include(['reload', 'load', 'unload', 'setconfig'], commandName)) dbot.api.event.emit('command', [ event ]);
|
||||||
dbot.save();
|
|
||||||
} else {
|
} else {
|
||||||
if(commandName !== this.config.commandPrefix) {
|
if(commandName !== this.config.commandPrefix) {
|
||||||
if(_.has(dbot.usage, commandName)) {
|
if(_.has(dbot.usage, commandName)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user