mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 02:45:54 +01:00
synchronization of transactions using promise so only one can be active
This commit is contained in:
@@ -16,8 +16,8 @@ async function deleteOld() {
|
||||
const cutoffId = await sql.getSingleValue("SELECT id FROM event_log ORDER BY id DESC LIMIT 1000, 1");
|
||||
|
||||
if (cutoffId) {
|
||||
await sql.doInTransaction(async db => {
|
||||
await sql.execute(db, "DELETE FROM event_log WHERE id < ?", [cutoffId]);
|
||||
await sql.doInTransaction(async () => {
|
||||
await sql.execute("DELETE FROM event_log WHERE id < ?", [cutoffId]);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user