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.
|
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
@@ -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
@@ -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):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user