summaryrefslogtreecommitdiffstats
path: root/stator
diff options
context:
space:
mode:
authorMichael Manfre2022-11-22 23:06:21 -0500
committerGitHub2022-11-22 21:06:21 -0700
commit9014d53399b501cee48d1b80bc5e0d59c229134a (patch)
tree04cea6edc05bcbd9567b1727e6859b46c56afe61 /stator
parent975c205d1d8152f68745597487862ead00c6dac9 (diff)
downloadtakahe-9014d53399b501cee48d1b80bc5e0d59c229134a.tar.gz
takahe-9014d53399b501cee48d1b80bc5e0d59c229134a.tar.bz2
takahe-9014d53399b501cee48d1b80bc5e0d59c229134a.zip
StatorRunner will refresh Config.system on each schedule_interval
Diffstat (limited to 'stator')
-rw-r--r--stator/runner.py3
1 files changed, 3 insertions, 0 deletions
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: