From 9014d53399b501cee48d1b80bc5e0d59c229134a Mon Sep 17 00:00:00 2001 From: Michael Manfre Date: Tue, 22 Nov 2022 23:06:21 -0500 Subject: StatorRunner will refresh Config.system on each schedule_interval --- stator/runner.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'stator') diff --git a/stator/runner.py b/stator/runner.py index 21c6128..a954a2e 100644 --- a/stator/runner.py +++ b/stator/runner.py @@ -8,6 +8,7 @@ from typing import List, Optional, Type from django.utils import timezone from core import exceptions +from core.models import Config from stator.models import StatorModel @@ -44,6 +45,8 @@ class StatorRunner: while True: # Do we need to do cleaning? if (time.monotonic() - self.last_clean) >= self.schedule_interval: + # Refresh the config + Config.system = await Config.aload_system() print(f"{self.handled} tasks processed so far") print("Running cleaning and scheduling") for model in self.models: -- cgit v1.2.3