Add isolated staging and synthetic weather workflow

This commit is contained in:
b0txec
2026-08-18 21:26:34 +03:00
parent b55ee891ce
commit b1fff676af
7 changed files with 363 additions and 11 deletions
+9 -3
View File
@@ -1,6 +1,6 @@
import cats.effect._
import cats.effect.unsafe.implicits.global
import cats.implicits.catsSyntaxTuple4Parallel
import cats.implicits._
import data.DataService
import db.{DBConnection, PostgresService}
import fetch.csv.{FileNameService}
@@ -43,7 +43,13 @@ object Main extends IOApp {
server <- Server.of(postgresService, dataService, fetchLvgmcService)
serverTask = server.run
exitCode <- (serverTask, fetchStationsTask, cleanupTask, fetchGribTask).parMapN((_, _, _, _) => ExitCode.Success)
scheduledTasks =
if (sys.env.get("ENABLE_SCHEDULED_JOBS").exists(_.equalsIgnoreCase("false")))
IO.never[Unit]
else
(fetchStationsTask, cleanupTask, fetchGribTask).parMapN((_, _, _) => ())
exitCode <- (serverTask, scheduledTasks).parMapN((_, _) => ExitCode.Success)
} yield exitCode
program.handleErrorWith { error =>
@@ -77,4 +83,4 @@ object Main extends IOApp {
} { writer =>
IO(writer.close()).handleErrorWith(e => IO(e.printStackTrace()))
}
}
}