timezone issues
Build and Push Docker Images / build-and-push (push) Successful in 28s

This commit is contained in:
Bram committed 2026-11-07 16:30:47 +01:00
1 parent 74df7780fd
commit d266a8258d
9 files changed
+32 -15

No files matched your search

+5 -3
View File
@@ -18,6 +18,7 @@ const settings = {
eventDurationMin: readNumber(process.env.EVENT_DURATION_MIN, 150, 1, 1440),
startGraceMin: readNumber(process.env.START_GRACE_MIN, 10, 0, 1440),
refreshIntervalSec: readNumber(process.env.REFRESH_INTERVAL_SEC, 60, 10, 3600),
sourceTimezone: (process.env.SOURCE_TIMEZONE || 'UTC').trim() || 'UTC',
timezone: (process.env.TIMEZONE || 'Europe/Brussels').trim() || 'Europe/Brussels',
listenPort: Math.round(readNumber(process.env.LISTEN_PORT, 8080, 1, 65535)),
upstreamTimeoutMs: readNumber(process.env.UPSTREAM_TIMEOUT_MS, 15000, 1000, 120000),
@@ -32,11 +33,11 @@ const settings = {
settings.eventDurationMs = settings.eventDurationMin * 60 * 1000;
settings.startGraceMs = settings.startGraceMin * 60 * 1000;
function validateTimezone(timezone) {
function validateTimezone(timezone, envName) {
try {
new Intl.DateTimeFormat('en-US', { timeZone: timezone });
} catch {
throw new Error(`Invalid TIMEZONE: ${timezone}`);
throw new Error(`Invalid ${envName}: ${timezone}`);
}
}
@@ -60,7 +61,8 @@ function validate() {
throw new Error('XTREAM_URL must use http or https');
}
validateTimezone(settings.timezone);
validateTimezone(settings.sourceTimezone, 'SOURCE_TIMEZONE');
validateTimezone(settings.timezone, 'TIMEZONE');
if (!settings.language) {
throw new Error('LANGUAGE must not be empty');