Skip to content

Commit

Permalink
Minor clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
lenguyenthanh committed Nov 25, 2023
1 parent f22da97 commit 890e3ed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions app/src/main/scala/App.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ object App extends IOApp.Simple:
def app: Resource[IO, Unit] =
for
config <- Resource.eval(AppConfig.load)
_ <- Resource.eval(KamonInitiator.apply.init(config.kamon))
_ <- Resource.eval(Logger[IO].info(s"Starting lila-fishnet with config: $config"))
_ <- Resource.eval(KamonInitiator.apply.init(config.kamon))
res <- AppResources.instance(config.redis)
_ <- FishnetApp(res, config).run()
yield ()
Expand All @@ -29,11 +29,11 @@ class FishnetApp(res: AppResources, config: AppConfig)(using Logger[IO]):
lilaClient <- Resource.pure(LilaClient(res.redisPubsub))
monitor = Monitor.apply
executor <- Resource.eval(Executor.instance(lilaClient, monitor))
workListenerJob = RedisSubscriberJob(executor, res.redisPubsub)
cleanJob = WorkCleaningJob(executor)
httpApi = HttpApi(executor, HealthCheck())
subscriberJob = RedisSubscriberJob(executor, res.redisPubsub)
cleaningJob = WorkCleaningJob(executor)
httpApi = HttpApi(executor, HealthCheck())
server <- MkHttpServer.apply.newEmber(config.server, httpApi.httpApp)
_ <- workListenerJob.run().background
_ <- cleanJob.run().background
_ <- subscriberJob.run().background
_ <- cleaningJob.run().background
_ <- Resource.eval(Logger[IO].info(s"Starting server on ${config.server.host}:${config.server.port}"))
yield ()
2 changes: 1 addition & 1 deletion app/src/main/scala/AppConfig.scala
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package lila.fishnet

import cats.effect.IO
import cats.syntax.all.*
import ciris.*
import ciris.http4s.*
import com.comcast.ip4s.*
import cats.effect.IO

object AppConfig:

Expand Down

0 comments on commit 890e3ed

Please sign in to comment.