diff --git a/app/crons/__init__.py b/app/crons/__init__.py index 0618e31a..1c72e96a 100644 --- a/app/crons/__init__.py +++ b/app/crons/__init__.py @@ -10,6 +10,9 @@ def start_cron_jobs(): """ This is the function that triggers the cron jobs. """ - Mixes().run() - - # schedule.run_pending() + Mixes() + schedule.run_all() + + while True: + schedule.run_pending() + time.sleep(1) diff --git a/app/crons/cron.py b/app/crons/cron.py index 939c94a7..35954768 100644 --- a/app/crons/cron.py +++ b/app/crons/cron.py @@ -13,7 +13,7 @@ class CronJob(ABC): self.name = name self.hours = hours - schedule.every(self.hours).seconds.do(self.run) + schedule.every(self.hours).hours.do(self.run) @abstractmethod def run(self): diff --git a/app/crons/mixes.py b/app/crons/mixes.py index 9f9f212a..e897775f 100644 --- a/app/crons/mixes.py +++ b/app/crons/mixes.py @@ -9,7 +9,7 @@ class Mixes(CronJob): """ def __init__(self): - super().__init__("mixes", 5) + super().__init__("mixes", 1) def run(self): """