Downlaod available forecasts from stac api
This commit is contained in:
@@ -7,6 +7,23 @@ import java.time.{ZoneOffset, ZonedDateTime}
|
||||
|
||||
object FetchServiceTest {
|
||||
def main(args: Array[String]): Unit = {
|
||||
// fetchFromTimeList().unsafeRunSync()
|
||||
fetchAvailableForecasts.unsafeRunSync()
|
||||
}
|
||||
|
||||
private def fetchAvailableForecasts(): IO[Unit] = {
|
||||
val program = for {
|
||||
fetch <- FetchService.of
|
||||
result <- fetch.fetchAvailableForecasts()
|
||||
(modelRun, forecastTimes) = result
|
||||
_ <- IO.println(modelRun)
|
||||
_ <- IO.println(forecastTimes)
|
||||
} yield ()
|
||||
|
||||
program
|
||||
}
|
||||
|
||||
private def fetchFromTimeList(): IO[Unit] = {
|
||||
val program = for {
|
||||
nowUTC <- IO(ZonedDateTime.now(ZoneOffset.UTC))
|
||||
referenceTime = FileName.getClosestReferenceTime(nowUTC)
|
||||
@@ -16,6 +33,6 @@ object FetchServiceTest {
|
||||
_ <- IO.println(nameList)
|
||||
} yield ()
|
||||
|
||||
program.unsafeRunSync()
|
||||
program
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user