separate DB connection for each transaction (just for the record, will be reverted probably)

This commit is contained in:
azivner
2017-11-28 17:04:47 -05:00
parent 4d95eb0762
commit fd764f6163
21 changed files with 326 additions and 429 deletions

View File

@@ -16,7 +16,9 @@ async function deleteOld() {
const cutoffId = await sql.getSingleValue("SELECT id FROM event_log ORDER BY id DESC LIMIT 1000, 1");
if (cutoffId) {
await sql.execute("DELETE FROM event_log WHERE id < ?", [cutoffId]);
await sql.doInTransaction(async db => {
await sql.execute(db, "DELETE FROM event_log WHERE id < ?", [cutoffId]);
});
}
}