Refactor save return type without Either

This commit is contained in:
Guntis Smaukstelis
2023-06-22 13:59:44 +03:00
parent 1abb12d92a
commit 3e1635d494
8 changed files with 84 additions and 21 deletions
+4
View File
@@ -9,13 +9,17 @@ import server.Server
object Main extends IOApp {
def run(args: List[String]): IO[ExitCode] = {
for {
// TODO run in separate thread
dbService <- DBService.of
dataService <- DataService.of(dbService)
fetch <- FetchService.of
fileFetchScheduler <- FileFetchScheduler.of(dataService, fetch)
schedulerTask = fileFetchScheduler.run.compile.drain
server <- Server.of(dataService, fetch)
serverTask = server.run
exitCode <- (serverTask, schedulerTask).parMapN((_, _) => ExitCode.Success)
} yield exitCode
}