feat: 서울문화포털 축제(동네·구청·공원)와 팝가 축제도 수집

This commit is contained in:
minaChoi committed 2026-10-08 11:52:14 +09:00
1 parent ce6efe979a
commit c7152563b9
9 files changed
+178 -9

No files matched your search

+2 -2
View File
@@ -24,7 +24,7 @@ from services.feed_service import build_feed_day, clear_feed_cache
from services.week_service import collect_events
from services.weekend_rank import WeekendRank
_POPGA_SEEN = "popga:lastmod" # {팝업 id: 마지막으로 읽은 lastmod}, 바뀐 페이지만 다시 읽는다
_POPGA_SEEN = "popga:lastmod:v2" # {팝업 id: 마지막으로 읽은 lastmod}, 바뀐 페이지만 다시 읽는다. 받는 분류가 바뀌면 이름을 바꿔 처음부터 읽는다
_POPGA_BATCH = 100
EVENTS_DONE = "events:collected" # 행사 수집을 마친 표시. 7일 유지, 없으면 worker 가 켜질 때 한 번 돈다
_EVENTS_TTL_SEC = 7 * 86400
@@ -147,7 +147,7 @@ async def refresh_popups() -> ErrorType:
async def _popup_count() -> int:
q = text("SELECT count(*) FROM public.event WHERE source_id LIKE 'popga:%' AND end_date >= (now() AT TIME ZONE 'Asia/Seoul')::date")
q = text("SELECT count(*) FROM public.event WHERE source_id LIKE 'popga:%' AND kind = 4 AND end_date >= (now() AT TIME ZONE 'Asia/Seoul')::date")
err, n = await DB_SESSION_MNG.execute_lambda(lambda s: s.scalar(q))
return n if err is ErrorType.SUCCESS and n is not None else 0