Files
SpotifyRecAlg/swingmusic/crons/cron.py
T
Tomas Dvorak 6e8fedf534 first commit
2026-04-13 17:46:58 +02:00

23 lines
393 B
Python

from abc import ABC, abstractmethod
import schedule
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.
"""
...