Download recent forecasts with checking local files

This commit is contained in:
Guntis Smaukstelis
2025-02-10 23:43:58 +02:00
parent 63d555bf5b
commit cf69372204
3 changed files with 49 additions and 7 deletions
+21 -1
View File
@@ -8,7 +8,27 @@ import java.time.{ZoneOffset, ZonedDateTime}
object FetchServiceTest {
def main(args: Array[String]): Unit = {
// fetchFromTimeList().unsafeRunSync()
fetchAvailableForecasts.unsafeRunSync()
// fetchAvailableForecasts.unsafeRunSync()
// generateFetchList().unsafeRunSync()
fetchRecentForecasts().unsafeRunSync()
}
private def fetchRecentForecasts(): IO[Unit] = {
val program = for {
fetch <- FetchService.of
result <- fetch.fetchRecentForecasts()
_ <- IO.println("-=fetch finished=-")
} yield ()
program
}
private def generateFetchList(): IO[Unit] = {
val program = for {
fetch <- FetchService.of
list <- fetch.generateFetchList()
_ <- IO.println(list)
} yield ()
program
}
private def fetchAvailableForecasts(): IO[Unit] = {