diff --git a/docker-compose.yml b/docker-compose.yml index d446127..a7ab152 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,14 +17,14 @@ services: orari: # Legge gli orari dalla scheda Google Business Profile (Places API) ogni - # 6 ore e li scrive in orari.json (ADR 0005). La chiave sta solo nel .env + # 24 ore e li scrive in orari.json (ADR 0005). La chiave sta solo nel .env # del server, copiato da deploy.sh a partire da .env.server locale. image: node:22-alpine container_name: officinezuliani-orari restart: always env_file: - .env - command: ["node", "/app/orari-google.mjs", "--out", "/dati/orari.json", "--ogni", "6"] + command: ["node", "/app/orari-google.mjs", "--out", "/dati/orari.json", "--ogni", "24"] volumes: - ./scripts:/app:ro - orari-dati:/dati diff --git a/docs/adr/0005-orari-da-google-places.md b/docs/adr/0005-orari-da-google-places.md index 3f7c3ea..a00c30e 100644 --- a/docs/adr/0005-orari-da-google-places.md +++ b/docs/adr/0005-orari-da-google-places.md @@ -17,3 +17,6 @@ Opening hours were hard-coded in the site. The client keeps them up to date on t - The client edits hours only on Google; the sign follows within 6 hours, without a deploy. The /dove-siamo table and JSON-LD update at the next deploy. - About 120 Place Details requests per month: expected to stay within Google Maps Platform free monthly usage, but a billing account is required — check the current price list. - If Google returns no regular hours, nothing is overwritten (no blank sign). + +## Update (2026-11-04) +Refresh interval changed from 6 to **24 hours** (owner's request: hours change rarely). The sign therefore follows a change on Google within a day; about 30 requests per month plus one per deploy. diff --git a/docs/runbooks/deploy.md b/docs/runbooks/deploy.md index d0b6254..a646d88 100644 --- a/docs/runbooks/deploy.md +++ b/docs/runbooks/deploy.md @@ -13,7 +13,7 @@ Requirements: SSH key access as `root@217.76.62.220`, Docker with buildx, Node/n ## Opening hours from Google (ADR 0005) - Find the Place ID once: `set -a; source .env.server; set +a; node scripts/orari-google.mjs --cerca "Officine Zuliani Udine"` - Each deploy refreshes `src/data/orari-google.json` (commit it with the deploy) -- On the server, container `officinezuliani-orari` refreshes `/dati/orari.json` every 6 hours: `docker compose logs orari` shows the last updates +- On the server, container `officinezuliani-orari` refreshes `/dati/orari.json` every 24 hours: `docker compose logs orari` shows the last updates ## Publish a hostname (one-time, Nginx Proxy Manager UI) 1. DNS: A record of the hostname → `217.76.62.220` diff --git a/scripts/orari-google.mjs b/scripts/orari-google.mjs index 744c07c..bd7f569 100644 --- a/scripts/orari-google.mjs +++ b/scripts/orari-google.mjs @@ -5,7 +5,7 @@ // Uso: // node scripts/orari-google.mjs --cerca "Officine Zuliani Udine" → trova il Place ID // node scripts/orari-google.mjs --out src/data/orari-google.json → aggiorna una volta -// node scripts/orari-google.mjs --out /dati/orari.json --ogni 6 → ripete ogni 6 ore (server) +// node scripts/orari-google.mjs --out /dati/orari.json --ogni 24 → ripete ogni 24 ore (server) // // Variabili d'ambiente: GOOGLE_PLACES_API_KEY, GOOGLE_PLACE_ID. // Se Google non risponde o i dati non sono validi, il file esistente NON viene toccato. diff --git a/src/data/orari-google.json b/src/data/orari-google.json index 82fbf4e..a386a96 100644 --- a/src/data/orari-google.json +++ b/src/data/orari-google.json @@ -1,6 +1,6 @@ { "fonte": "google", - "aggiornato": "2026-11-04T15:14:44.384Z", + "aggiornato": "2026-11-04T15:22:48.382Z", "statoAttivita": "OPERATIONAL", "settimana": [ {