mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 09:47:08 +00:00
@@ -679,6 +679,21 @@ class Datastore:
|
|||||||
# We do not commit if we've been passed a cursor, instead
|
# We do not commit if we've been passed a cursor, instead
|
||||||
# we assume that we are in the middle of a transaction
|
# we assume that we are in the middle of a transaction
|
||||||
|
|
||||||
|
def adjust_planner(self, cursor = None):
|
||||||
|
"""
|
||||||
|
Adjust estimated times on the planner
|
||||||
|
"""
|
||||||
|
if cursor is None:
|
||||||
|
cur = self.conn.cursor()
|
||||||
|
else:
|
||||||
|
cur = cursor
|
||||||
|
|
||||||
|
qry = "CALL adjust_planner();"
|
||||||
|
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
|
||||||
|
|
||||||
def housekeep_event_log(self, cursor = None):
|
def housekeep_event_log(self, cursor = None):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ if __name__ == '__main__':
|
|||||||
print(f'Survey: {survey["id"]} ({survey["schema"]})')
|
print(f'Survey: {survey["id"]} ({survey["schema"]})')
|
||||||
db.set_survey(survey["schema"])
|
db.set_survey(survey["schema"])
|
||||||
|
|
||||||
|
db.adjust_planner()
|
||||||
db.housekeep_event_log()
|
db.housekeep_event_log()
|
||||||
|
|
||||||
print("Done")
|
print("Done")
|
||||||
|
|||||||
Reference in New Issue
Block a user