fix: 처음 온 지역의 각이 비어 보이던 것 (예보 받는 동안 3초만 기다리고 빈 피드를 1분 저장하던 것)

This commit is contained in:
minaChoi committed 2026-10-13 17:02:41 +09:00
1 parent 92cfeabe19
commit 599ef05dcf
3 files changed
+6 -4

No files matched your search

+3
View File
@@ -323,6 +323,9 @@ class FeedService:
async with redis_lock("lock:feed:build", ttl_sec=20):
await build_feed_day(day, self.crud, self.season_crud, self.regions)
res, partial = await self._assemble(region, now, day, slot, sunset_at)
# 각을 못 낸 피드는 저장하지 않는다. 처음 온 지역은 예보를 받는 중이라 다음 요청에서 바로 채운다
if not res.bands.top5:
return ErrorType.SUCCESS, res
try:
await REDIS.conn.set(key, res.model_dump_json(), ex=_PARTIAL_TTL if partial else feed_ttl_sec(now, sunset_at))
except RedisError as e: