From c4516c6f2330f2d5e39da5b3e3970e789a1915f1 Mon Sep 17 00:00:00 2001 From: AI Assistant Date: Fri, 27 Mar 2026 06:35:23 +0200 Subject: [PATCH] fix: set TZ=Europe/Bucharest in Docker + scheduler diagnostic logs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The container was running on UTC by default — the 1-5 AM window was actually 4-8 AM Romania time, missing the intended night window. - Add TZ=Europe/Bucharest + tzdata package to Dockerfile - Add startup diagnostic logs: server time, timezone, ETERRA creds check Co-Authored-By: Claude Opus 4.6 (1M context) --- Dockerfile | 3 ++- src/modules/parcel-sync/services/auto-refresh-scheduler.ts | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 0905f46..3b066ae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,9 +37,10 @@ FROM node:22-alpine AS runner WORKDIR /app ENV NODE_ENV=production +ENV TZ=Europe/Bucharest # Install system deps + create user in a single layer -RUN apk add --no-cache gdal gdal-tools ghostscript qpdf \ +RUN apk add --no-cache gdal gdal-tools ghostscript qpdf tzdata \ && addgroup --system --gid 1001 nodejs \ && adduser --system --uid 1001 nextjs diff --git a/src/modules/parcel-sync/services/auto-refresh-scheduler.ts b/src/modules/parcel-sync/services/auto-refresh-scheduler.ts index 42743f5..7687775 100644 --- a/src/modules/parcel-sync/services/auto-refresh-scheduler.ts +++ b/src/modules/parcel-sync/services/auto-refresh-scheduler.ts @@ -247,13 +247,20 @@ if (!g.__autoRefreshTimer) { } }, 60_000); + const now = new Date(); console.log( `[auto-refresh] Scheduler pornit — verificare la fiecare ${CHECK_INTERVAL_MS / 60_000} min`, ); + console.log( + `[auto-refresh] Server time: ${now.toLocaleString("ro-RO")} (TZ=${process.env.TZ ?? "system"}, offset=${now.getTimezoneOffset()}min)`, + ); console.log( `[auto-refresh] Weekday: ${NIGHT_START_HOUR}:00–${NIGHT_END_HOUR}:00 refresh incremental`, ); console.log( `[auto-refresh] Weekend: Vin/Sam/Dum 23:00–04:00 deep sync municipii`, ); + console.log( + `[auto-refresh] ETERRA creds: ${process.env.ETERRA_USERNAME ? "OK" : "MISSING"}`, + ); }