properly setup crons

This commit is contained in:
cwilvx
2024-11-01 12:40:37 +03:00
parent 1fdd5ba4d1
commit 38d08f07bb
3 changed files with 8 additions and 5 deletions
+6 -3
View File
@@ -10,6 +10,9 @@ def start_cron_jobs():
""" """
This is the function that triggers the cron jobs. This is the function that triggers the cron jobs.
""" """
Mixes().run() Mixes()
schedule.run_all()
# schedule.run_pending()
while True:
schedule.run_pending()
time.sleep(1)
+1 -1
View File
@@ -13,7 +13,7 @@ class CronJob(ABC):
self.name = name self.name = name
self.hours = hours self.hours = hours
schedule.every(self.hours).seconds.do(self.run) schedule.every(self.hours).hours.do(self.run)
@abstractmethod @abstractmethod
def run(self): def run(self):
+1 -1
View File
@@ -9,7 +9,7 @@ class Mixes(CronJob):
""" """
def __init__(self): def __init__(self):
super().__init__("mixes", 5) super().__init__("mixes", 1)
def run(self): def run(self):
""" """