Add final fixes for system user and automated backups

This commit is contained in:
Andrew 2021-12-20 22:34:20 -05:00
parent 9ae0991f4b
commit b4f247bb95
2 changed files with 2 additions and 4 deletions

View File

@ -74,11 +74,8 @@ class db_shortcuts:
try:
if query.count() > 0:
for s in query:
if s.user_id == 0:
print(s.user_id)
rows.append(model_to_dict(s))
except Exception as e:
print('QUERY: ', query)
logger.warning("Database Error: {}".format(e))
pass

View File

@ -73,8 +73,9 @@ class TasksManager:
logger.info("Loading schedule ID#{i}: '{a}' every {n} {t} at {s}".format(
i=j.schedule_id, a=j.action, n=j.interval, t=j.interval_type, s=j.start_time))
try:
print(self.controller.users.get_id_by_name('system'))
getattr(schedule.every(j.interval), j.interval_type).at(j.start_time).do(
self.controller.management.send_command, 0, j.server_id, "127.27.23.89", j.action)
self.controller.management.send_command, self.controller.users.get_id_by_name('system'), j.server_id, "127.27.23.89", j.action)
except schedule.ScheduleValueError as e:
logger.critical("Scheduler value error occurred: {} on ID#{}".format(e, j.schedule_id))
else: