Files
ems/backend/app/refresh_negative_prices.py
Dusan Vojacek 014c6f193b
Some checks failed
CI and deploy / migration-check (push) Failing after 17s
CI and deploy / deploy (push) Has been skipped
refactor main.py
2026-04-19 20:42:53 +02:00

23 lines
592 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""Sdílený hook po importu cen / forecastu obnova cache predikce záporných cen."""
from __future__ import annotations
import logging
import asyncpg
logger = logging.getLogger(__name__)
async def refresh_negative_price_predictions(conn: asyncpg.Connection, site_id: int) -> None:
try:
await conn.fetch(
"SELECT * FROM ems.fn_predict_negative_price_windows($1, 7)", site_id
)
except Exception:
logger.warning(
"fn_predict_negative_price_windows failed for site %s",
site_id,
exc_info=True,
)