only save the db to disk every minute

This commit is contained in:
reality 2015-07-19 16:56:08 +00:00
parent 36496b64ac
commit 5f8cbe3fb1
2 changed files with 4 additions and 1 deletions

View File

@ -51,6 +51,10 @@ var admin = function(dbot) {
fs.writeFileSync('config.json', JSON.stringify(config, null, ' '));
}
};
this.onLoad = function() {
dbot.api.timers.addTimer(60000, dbot.save);
};
};
exports.fetch = function(dbot) {

View File

@ -101,7 +101,6 @@ var command = function(dbot) {
}
}
if(!_.include(['reload', 'load', 'unload', 'setconfig'], commandName)) dbot.api.event.emit('command', [ event ]);
dbot.save();
} else {
if(commandName !== this.config.commandPrefix) {
if(_.has(dbot.usage, commandName)) {