From cfb807980907d95338bedebbfaa3da4d76e58f7b Mon Sep 17 00:00:00 2001 From: haneulai Date: Tue, 27 Jan 2026 16:45:59 +0900 Subject: [PATCH] fix: Increase Supabase query limit to fetch all historical stats --- app/routers/stats.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/routers/stats.py b/app/routers/stats.py index a2d7106..a09f646 100644 --- a/app/routers/stats.py +++ b/app/routers/stats.py @@ -76,8 +76,9 @@ async def get_plant_stats( stats_query = stats_query.lte("date", today_str) stats_query = stats_query.order("date", desc=False) - - stats_result = stats_query.execute() + + # Supabase 기본 limit이 1000이므로 충분히 늘려줌 (10년치 = 약 3650일) + stats_result = stats_query.limit(10000).execute() # 데이터 맵핑 {날짜: 발전량} data_map = {row["date"]: row["total_generation"] or 0 for row in stats_result.data}