diff --git a/world_boss/app/config.py b/world_boss/app/config.py index 6b3bae1..f557189 100644 --- a/world_boss/app/config.py +++ b/world_boss/app/config.py @@ -32,6 +32,7 @@ class Settings(BaseSettings): headless_jwt_iss: str headless_jwt_algorithm: str planet_id: str + scheduler_interval: int = 60 * 5 class Config: env_file = ".env" @@ -70,6 +71,7 @@ class Config: "headless_jwt_iss": {"env": "HEADLESS_JWT_ISS"}, "headless_jwt_algorithm": {"env": "HEADLESS_JWT_ALGORITHM"}, "planet_id": {"env": "PLANET_ID"}, + "scheduler_interval": {"env": "SCHEDULER_INTERVAL"}, } diff --git a/world_boss/app/scheduler.py b/world_boss/app/scheduler.py index 3d5ae43..747136a 100644 --- a/world_boss/app/scheduler.py +++ b/world_boss/app/scheduler.py @@ -1,5 +1,6 @@ from apscheduler.schedulers.background import BackgroundScheduler +from world_boss.app.config import config from world_boss.app.tasks import check_season scheduler = BackgroundScheduler() @@ -9,4 +10,4 @@ def check(): check_season.delay() -scheduler.add_job(check, "interval", seconds=60 * 30) +scheduler.add_job(check, "interval", seconds=config.scheduler_interval)