hydro : précalcul des estimations Hydro-Québec dans la boucle de sync + commande CLI hydro-precompute
data/rdl.db (base générée) ajouté au .gitignore. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
3 changed files +11 −0
modified
.gitignore
+1 −0
@@ -18,3 +18,4 @@ data/gaz.db | ||
| 18 | 18 | data/transit.db |
| 19 | 19 | data/commerces.db |
| 20 | 20 | data/hydro.db |
| 21 | +data/rdl.db | |
modified
immoka/ingest.py
+5 −0
@@ -106,4 +106,9 @@ def watch(interval_seconds: int = 3600) -> None: | ||
| 106 | 106 | except Exception as exc: |
| 107 | 107 | print(f"[immo-ka] imgaudit: erreur non bloquante: {exc}", file=sys.stderr) |
| 108 | 108 | print(f"[immo-ka] prochaine synchronisation dans {interval_seconds // 60} min") |
| 109 | + try: # estimation Hydro-Québec des nouvelles annonces (cache persistant, coût borné) | |
| 110 | + from . import hydro | |
| 111 | + hydro.precompute(limit=100, budget=30) | |
| 112 | + except Exception as exc: | |
| 113 | + print(f"[immoka] hydro: erreur non bloquante: {exc}", file=sys.stderr) | |
| 109 | 114 | time.sleep(interval_seconds) |
modified
run.py
+5 −0
@@ -58,6 +58,11 @@ def main() -> None: | ||
| 58 | 58 | elif cmd == "gaz-refresh": |
| 59 | 59 | from immoka import gaz |
| 60 | 60 | print(f"[gaz] {gaz.refresh()} stations") |
| 61 | + elif cmd == "hydro-precompute": | |
| 62 | + from immoka import hydro | |
| 63 | + n = int(sys.argv[2]) if len(sys.argv) > 2 else 100 | |
| 64 | + b = int(sys.argv[3]) if len(sys.argv) > 3 else 40 | |
| 65 | + hydro.precompute(limit=n, budget=b) | |
| 61 | 66 | elif cmd == "inondation-build": |
| 62 | 67 | from immoka import inondation |
| 63 | 68 | inondation.build() |
| 64 | 69 | |