Moved to app/Main, scheduler helper methods moved to unfinished test

This commit is contained in:
Guntis Smaukstelis
2023-05-25 13:51:45 +03:00
parent d651e3f3bd
commit 1abb12d92a
5 changed files with 30 additions and 24 deletions
+25
View File
@@ -0,0 +1,25 @@
package fetch
import cats.effect.{Clock, IO}
import fs2.Stream
class SchedulerSpec {
// private def testTask: IO[Unit] = {
// log.info("Running task")
// }
//
// def run(implicit clock: Clock[IO]): Stream[IO, Nothing] = {
// Stream.eval(durationToNextHalfHour).flatMap { delay =>
// (Stream.sleep[IO](delay) ++ Stream.awakeEvery[IO](1.hour)).evalMap(_ => testTask).drain
// }
// }
//
// def main(args: Array[String]): Unit = {
// // run.compile.drain.unsafeRunSync()
// for {
// scheduler <- Scheduler.of
// fetch <- FetchService.of
// fetchTask = new FileNameService().generateCurrentHour.flatMap(fetch.fetchSingleFile)
// } yield scheduler.scheduleTask(fetchTask).compile.drain.unsafeRunSync()
// }
}