mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-03 20:13:02 +00:00
86fabcd5e3
+ merge main.py and manage.py + move start logic to swingmusic/__main__.py + add a run.py on the project root
24 lines
394 B
Python
24 lines
394 B
Python
import schedule
|
|
|
|
|
|
from abc import ABC, abstractmethod
|
|
|
|
|
|
class CronJob(ABC):
|
|
"""
|
|
A cron job that will be run on a regular interval.
|
|
"""
|
|
|
|
name: str
|
|
hours: int = 1
|
|
|
|
def __init__(self):
|
|
schedule.every(self.hours).hours.do(self.run)
|
|
|
|
@abstractmethod
|
|
def run(self):
|
|
"""
|
|
The function that will be called by the cron job.
|
|
"""
|
|
...
|