From 4892916e16729a380a0a782546dfd915d51610a6 Mon Sep 17 00:00:00 2001 From: Profitroll <47523801+profitrollgame@users.noreply.github.com> Date: Tue, 20 Dec 2022 22:24:46 +0100 Subject: [PATCH] Added scheduler --- modules/scheduler.py | 3 +++ photos_api.py | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 modules/scheduler.py diff --git a/modules/scheduler.py b/modules/scheduler.py new file mode 100644 index 0000000..0ec4214 --- /dev/null +++ b/modules/scheduler.py @@ -0,0 +1,3 @@ +from apscheduler.schedulers.asyncio import AsyncIOScheduler + +scheduler = AsyncIOScheduler() \ No newline at end of file diff --git a/photos_api.py b/photos_api.py index 1dc98ca..b464449 100644 --- a/photos_api.py +++ b/photos_api.py @@ -1,6 +1,7 @@ from os import makedirs, sep from modules.app import app from modules.utils import * +from modules.scheduler import scheduler from modules.extensions_loader import dynamic_import_from_src from fastapi.responses import FileResponse @@ -14,4 +15,6 @@ async def favicon(): #================================================================================= dynamic_import_from_src("extensions", star_import = True) -#================================================================================= \ No newline at end of file +#================================================================================= + +scheduler.start() \ No newline at end of file