feat: 쇼츠 목록을 요청 때가 아니라 워커가 하루 3번(07·12·18시 10분)과 켤 때 받아 둠, 캐시는 2일 — 사용자는 유튜브 응답을 기다리지 않음

This commit is contained in:
minaChoi committed 2026-10-26 15:16:08 +09:00
1 parent e0a723a3e4
commit ba70fbcd49
4 files changed
+39 -4

No files matched your search

+5 -2
View File
@@ -5,7 +5,7 @@ from apscheduler.schedulers.asyncio import AsyncIOScheduler
from common.database.db_session_manager import DB_SESSION_MNG
from common.logger import LOG
from scheduler.jobs import build_today_feed, cleanup_old_rows, refresh_air_stations, refresh_events, refresh_openmeteo_weather, refresh_weekend_rank
from scheduler.jobs import build_today_feed, cleanup_old_rows, refresh_air_stations, refresh_events, refresh_openmeteo_weather, refresh_shorts, refresh_weekend_rank
async def daily() -> None:
@@ -24,8 +24,11 @@ async def main() -> None:
scheduler.add_job(refresh_events, "cron", day_of_week="mon", hour=4, minute=0, max_instances=1, coalesce=True)
scheduler.add_job(refresh_events, kwargs={"only_if_missing": True}, max_instances=1)
scheduler.add_job(refresh_openmeteo_weather, "cron", hour="3,9,15,21", minute=10, max_instances=1, coalesce=True)
# 오늘 화면 쇼츠 줄: 하루 1~2개 올라오니 하루 3번이면 충분하다. 켤 때도 한 번.
scheduler.add_job(refresh_shorts, "cron", hour="7,12,18", minute=10, max_instances=1, coalesce=True)
scheduler.add_job(refresh_shorts, max_instances=1)
scheduler.start()
LOG.info("[worker] started, daily job at 03:00 KST, weekend rank at 06:40·18:40 KST, events on Mon 04:00 KST, openmeteo job at 03·09·15·21:10 KST")
LOG.info("[worker] started, daily job at 03:00 KST, weekend rank at 06:40·18:40 KST, events on Mon 04:00 KST, openmeteo job at 03·09·15·21:10 KST, shorts at 07·12·18:10 KST")
stop = asyncio.Event()
loop = asyncio.get_running_loop()