mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-03 20:13:02 +00:00
properly setup crons
This commit is contained in:
@@ -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
@@ -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
@@ -9,7 +9,7 @@ class Mixes(CronJob):
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
super().__init__("mixes", 5)
|
||||
super().__init__("mixes", 1)
|
||||
|
||||
def run(self):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user