From 9213d3544b2e043ed501994e7d54ca4a5076bff9 Mon Sep 17 00:00:00 2001 From: Dusan Vojacek Date: Fri, 12 Jun 2026 14:54:42 +0200 Subject: [PATCH] =?UTF-8?q?HOTFIX=203:=20comment=20signatura=20(int,=20boo?= =?UTF-8?q?lean)=20=E2=80=94=20deploy=20R=5F=5F018=20padal=2042883;=20forc?= =?UTF-8?q?e=20refresh=20po=20PATCH=20kalibrace?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Throttle commit změnil signaturu fn_refresh_site_pv_delta_profile_cache na (int, boolean default false), ale comment on function dál mířil na (int) → repeatable migrace selhala (function does not exist), oba deploye (7da7205 i 18bf93a) spadly — na produkci NENÍ nic z delta hotfixů. PATCH kalibrace nově volá refresh s p_force=true (throttle nesmí zadržet přepočet po změně parametrů). Co-Authored-By: Claude Opus 4.8 (1M context) --- backend/app/routers/site_configuration.py | 4 +++- db/routines/R__018_fn_pv_delta_profile_cache.sql | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/app/routers/site_configuration.py b/backend/app/routers/site_configuration.py index 7f8f156..4417283 100644 --- a/backend/app/routers/site_configuration.py +++ b/backend/app/routers/site_configuration.py @@ -148,7 +148,9 @@ async def patch_pv_forecast_calibration( detail="PV forecast calibration row missing; run migration V057", ) await conn.execute( - "select ems.fn_refresh_site_pv_delta_profile_cache($1::int)", + # p_force=true: uživatel právě změnil kalibraci — throttle 6 h nesmí + # nechat starou cache (čtenář ji od HOTFIXu 2/2 vrací bez přepočtu) + "select ems.fn_refresh_site_pv_delta_profile_cache($1::int, true)", site_id, ) row = await conn.fetchrow( diff --git a/db/routines/R__018_fn_pv_delta_profile_cache.sql b/db/routines/R__018_fn_pv_delta_profile_cache.sql index 7cd4295..e86d2de 100644 --- a/db/routines/R__018_fn_pv_delta_profile_cache.sql +++ b/db/routines/R__018_fn_pv_delta_profile_cache.sql @@ -54,7 +54,7 @@ begin end; $fn$; -comment on function ems.fn_refresh_site_pv_delta_profile_cache(int) is +comment on function ems.fn_refresh_site_pv_delta_profile_cache(int, boolean) is 'Přepočte a uloží delta_profile_cache pro site (volá fn_pv_forecast_delta_profile).'; create or replace function ems.fn_pv_forecast_delta_profile_cached(