Merge branch '459-activitypub-integration' of ssh://numinibsd/git/base/enigma-bbs into 459-activitypub-integration

This commit is contained in:
Bryan Ashby 2023-08-24 13:07:41 -06:00
commit ea6ab5a146
No known key found for this signature in database
GPG Key ID: C2C1B501E4EFD994
1 changed files with 13 additions and 0 deletions

View File

@ -22,6 +22,7 @@ exports.loadDatabaseForMod = loadDatabaseForMod;
exports.getISOTimestampString = getISOTimestampString;
exports.sanitizeString = sanitizeString;
exports.initializeDatabases = initializeDatabases;
exports.scheduledEventOptimizeDatabases = scheduledEventOptimizeDatabases;
exports.dbs = dbs;
@ -515,3 +516,15 @@ dbs.message.run(
return cb(null);
},
};
function scheduledEventOptimizeDatabases(args, cb) {
async.forEachSeries(
Object.keys(dbs),
(db, nextDb) => {
return db.run('PRAGMA OPTIMIZE', nextDb);
},
err => {
return cb(err);
}
);
}