mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 06:47:07 +00:00
27 lines
498 B
Python
Executable File
27 lines
498 B
Python
Executable File
#!/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"])
|
|
|
|
print("Planner adjustment")
|
|
db.adjust_planner()
|
|
print("Event log housekeeping")
|
|
db.housekeep_event_log()
|
|
|
|
print("Done")
|