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.
"""
Mixes().run()
# schedule.run_pending()
Mixes()
schedule.run_all()
while True:
schedule.run_pending()
time.sleep(1)
+1 -1
View File
@@ -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):
+1 -1
View File
@@ -9,7 +9,7 @@ class Mixes(CronJob):
"""
def __init__(self):
super().__init__("mixes", 5)
super().__init__("mixes", 1)
def run(self):
"""