feat: chargements de pages best-effort au boot (tableau, sources) (#78)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Colin Maudry
2026-06-12 13:58:50 +02:00
parent fa2709b38c
commit cb93dbe05a
4 changed files with 93 additions and 7 deletions
+16
View File
@@ -41,3 +41,19 @@ DOMAIN_NAME = (
if os.getenv("DEVELOPMENT", "False").lower() == "true"
else "decp.info"
)
def get_data_update_timestamp(
parquet_path: str, fallback_path: str | None = None
) -> float | None:
"""Date de MAJ des données, best-effort, sans jamais lever (usage au boot)."""
try:
return get_last_modified(parquet_path)
except Exception as e:
logger.warning(f"Date de mise à jour des données indisponible ({e})")
if fallback_path:
try:
return os.path.getmtime(fallback_path)
except OSError:
pass
return None