mirror of
https://github.com/Dvorinka/SpotifyRecAlg.git
synced 2026-06-05 04:53:02 +00:00
first commit
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
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.
|
||||
"""
|
||||
...
|
||||
Reference in New Issue
Block a user