mirror of
https://github.com/Balshgit/mosgortrans.git
synced 2026-02-03 11:20:56 +03:00
fix scheduler
This commit is contained in:
@@ -27,7 +27,7 @@ class Application:
|
||||
TELEGRAM_API_TOKEN, '{TELEGRAM_API_TOKEN}'
|
||||
)
|
||||
)
|
||||
bot_scheduler.start()
|
||||
self.scheduler.start()
|
||||
|
||||
async def _on_shutdown(self, dp: Dispatcher) -> None:
|
||||
logger.warning('Shutting down..')
|
||||
|
||||
@@ -47,12 +47,13 @@ bot_cron_jobs = {
|
||||
|
||||
|
||||
class BotScheduler:
|
||||
scheduler = AsyncIOScheduler()
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
cron_jobs: dict[str, dict[str, Any]],
|
||||
):
|
||||
self.cron_jobs = cron_jobs
|
||||
self.scheduler = AsyncIOScheduler()
|
||||
|
||||
def add_scheduler_jobs(self, jobs_name: str) -> None:
|
||||
cron_jobs = self.cron_jobs.get(jobs_name)
|
||||
|
||||
Reference in New Issue
Block a user