Split ENABLE_LEGACY_PROVIDER_JOBS into independent FTP/HARMONIE flags

Real LVGMC FTP credentials arrived today; real DMI HARMONIE
credentials haven't. The combined flag would have enabled both the
moment FTP's were ready, crash-looping the app on HARMONIE's still-
placeholder values via parMapN — caught this before it happened
(the Grib job was ~15 min from its first scheduled run). Split into
ENABLE_LVGMC_FTP_JOBS and ENABLE_HARMONIE_JOBS so each provider can
be enabled independently as its own credentials become real.
This commit is contained in:
b0txec
2026-08-23 21:32:11 +03:00
parent 3315f00fb1
commit 3eddf95008
8 changed files with 64 additions and 24 deletions
+17 -3
View File
@@ -68,12 +68,26 @@ object Main extends IOApp {
else
(fetchOpenDataStationsTask, cleanupTask).parMapN((_, _) => ())
legacyProviderTasks =
if (sys.env.get("ENABLE_LEGACY_PROVIDER_JOBS").exists(_.equalsIgnoreCase("true")))
(fetchStationsTask, fetchGribTask).parMapN((_, _) => ())
// FTP (LVGMC) and HARMONIE (DMI) are gated independently: each only
// throws once its own real credentials arrive, and they arrive on
// different timelines (FTP creds obtained 2026-08-23; HARMONIE still
// pending). A single combined flag would enable both together the
// moment either one's credentials were ready, crash-looping the app
// on whichever provider still had placeholders.
ftpStationTask =
if (sys.env.get("ENABLE_LVGMC_FTP_JOBS").exists(_.equalsIgnoreCase("true")))
fetchStationsTask
else
IO.never[Unit]
harmonieTask =
if (sys.env.get("ENABLE_HARMONIE_JOBS").exists(_.equalsIgnoreCase("true")))
fetchGribTask
else
IO.never[Unit]
legacyProviderTasks = (ftpStationTask, harmonieTask).parMapN((_, _) => ())
scheduledTasks = (safeTasks, legacyProviderTasks).parMapN((_, _) => ())
exitCode <- (serverTask, scheduledTasks).parMapN((_, _) => ExitCode.Success)