fix: 피드 캐시를 다음 초단기예보가 나오는 시각(:45)에 끝내 비 반영 각 점수가 늦게 보이지 않게

This commit is contained in:
minaChoi committed 2026-10-13 09:25:26 +09:00
1 parent 8a677a766d
commit 055eec69ef
2 files changed
+15 -3

No files matched your search

+12
View File
@@ -89,6 +89,18 @@ def test_feed_cache_expires_when_time_slot_changes():
assert feed_ttl_sec(now, sunset) <= 600
def test_feed_cache_expires_when_ultra_forecast_arrives():
"""초단기예보 비가 각 점수에 들어가니, 다음 초단기예보가 나오는 :45 에 캐시가 끝나야 한다."""
from datetime import datetime
from common.utils.kma_time import KST
from services.feed_service import feed_ttl_sec
now = datetime(2026, 10, 2, 13, 20, tzinfo=KST)
sunset = datetime(2026, 10, 2, 18, 10, tzinfo=KST)
assert feed_ttl_sec(now, sunset) == 25 * 60
def _card(post_type, post_id=1):
from datetime import datetime