[plugins] Fix scheduler accessing database while unbound from session

Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
This commit is contained in:
Ferdinand Thiessen 2022-08-25 18:45:01 +02:00
parent 88a4dc24f2
commit 9e8117e554
1 changed files with 3 additions and 0 deletions

View File

@ -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())