Launch database housekeeping tasks from runner

This commit is contained in:
D. Berge
2022-05-01 19:57:16 +02:00
parent 39690c991b
commit fd41d2a6fa
3 changed files with 44 additions and 0 deletions

View File

@@ -679,3 +679,19 @@ class Datastore:
# We do not commit if we've been passed a cursor, instead
# we assume that we are in the middle of a transaction
def housekeep_event_log(self, cursor = None):
"""
Call housekeeping actions on the event log
"""
if cursor is None:
cur = self.conn.cursor()
else:
cur = cursor
qry = "CALL augment_event_data();"
cur.execute(qry)
if cursor is None:
self.maybe_commit()
# We do not commit if we've been passed a cursor, instead
# we assume that we are in the middle of a transaction