From 9e8117e5546f0ba616709c56de7945c08b8e5378 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Thu, 25 Aug 2022 18:45:01 +0200 Subject: [PATCH] [plugins] Fix scheduler accessing database while unbound from session Signed-off-by: Ferdinand Thiessen --- flaschengeist/plugins/scheduler.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flaschengeist/plugins/scheduler.py b/flaschengeist/plugins/scheduler.py index 268bafd..1a31c8a 100644 --- a/flaschengeist/plugins/scheduler.py +++ b/flaschengeist/plugins/scheduler.py @@ -60,6 +60,9 @@ class SchedulerPlugin(Plugin): self.blueprint.add_url_rule("/cron", view_func=__view_func) def run_tasks(self): + from ..database import db + self = db.session.merge(self) + changed = False now = datetime.now() status = self.get_setting("status", default=dict())