first recommendation draft

This commit is contained in:
cwilvx
2024-10-25 23:26:08 +03:00
parent a26373669d
commit c4a73f0d63
15 changed files with 393 additions and 6 deletions
+23
View File
@@ -0,0 +1,23 @@
import schedule
from abc import ABC, abstractmethod
class CronJob(ABC):
"""
A cron job that will be run on a regular interval.
"""
def __init__(self, name: str, hours: int):
self.name = name
self.hours = hours
schedule.every(self.hours).seconds.do(self.run)
@abstractmethod
def run(self):
"""
The function that will be called by the cron job.
"""
...