Files
dougal-software/bin/housekeep_database.py

27 lines
498 B
Python
Raw Normal View History

#!/usr/bin/python3
"""
Do housekeeping actions on the database.
"""
import configuration
from datastore import Datastore
if __name__ == '__main__':
print("Connecting to database")
db = Datastore()
surveys = db.surveys()
print("Reading surveys")
for survey in surveys:
print(f'Survey: {survey["id"]} ({survey["schema"]})')
db.set_survey(survey["schema"])
2022-05-08 15:26:15 +02:00
print("Planner adjustment")
db.adjust_planner()
2022-05-08 15:26:15 +02:00
print("Event log housekeeping")
db.housekeep_event_log()
print("Done")