Skip to content

Commit

Permalink
Update cats-effect & fs2-cron
Browse files Browse the repository at this point in the history
  • Loading branch information
danslapman committed Apr 1, 2024
1 parent 1a71903 commit 8a7d3f7
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions backend/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ThisBuild / semanticdbEnabled := true
val utils = (project in file("utils"))
.settings(Settings.common)
.settings(
libraryDependencies ++= Dependencies.zio ++ Dependencies.scalatest ++ Dependencies.metrics
libraryDependencies ++= Dependencies.cats ++ Dependencies.zio ++ Dependencies.scalatest ++ Dependencies.metrics
)

val circeUtils = (project in file("circe-utils"))
Expand Down Expand Up @@ -67,7 +67,7 @@ val mockingbird = (project in file("mockingbird"))
"com.lihaoyi" %% "scalatags" % "0.9.1",
"tf.tofu" %% "derevo-circe" % Versions.derevo,
"org.webjars.npm" % "swagger-ui-dist" % "3.32.5",
"eu.timepit" %% "fs2-cron-core" % "0.2.2",
"eu.timepit" %% "fs2-cron-cron4s" % "0.9.0",
"com.softwaremill.sttp.client4" %% "zio" % Versions.sttp,
"com.softwaremill.sttp.client4" %% "circe" % Versions.sttp,
"org.apache.tika" % "tika-core" % "2.1.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package ru.tinkoff.tcb.mockingbird.stream

import eu.timepit.fs2cron.awakeEveryCron
import eu.timepit.fs2cron.cron4s.Cron4sScheduler
import eu.timepit.refined.*
import eu.timepit.refined.numeric.*
import fs2.Stream
import tofu.logging.Logging
import tofu.logging.impl.ZUniversalLogging
import zio.interop.catz.*
import zio.interop.catz.implicits.*

import ru.tinkoff.tcb.criteria.*
import ru.tinkoff.tcb.criteria.Typed.*
Expand All @@ -20,7 +19,9 @@ import ru.tinkoff.tcb.mockingbird.model.Scope
final class EphemeralCleaner(stubDAO: HttpStubDAO[Task], scenarioDAO: ScenarioDAO[Task]) {
private val log: Logging[UIO] = new ZUniversalLogging(this.getClass.getName)

private val trigger = awakeEveryCron[Task](midnight)
private val cronScheduler = Cron4sScheduler.systemDefault[Task]

private val trigger = cronScheduler.awakeEvery(midnight)

private val secondsInDay = 60 * 60 * 24

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import mouse.boolean.*
import sttp.client4.{Backend as SttpBackend, *}
import sttp.model.Method
import zio.interop.catz.*
import zio.interop.catz.implicits.*

import ru.tinkoff.tcb.logging.MDCLogging
import ru.tinkoff.tcb.mockingbird.api.Tracing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import scala.util.control.NonFatal

import fs2.Stream
import zio.interop.catz.*
import zio.interop.catz.implicits.*

import ru.tinkoff.tcb.logging.MDCLogging
import ru.tinkoff.tcb.mockingbird.api.WLD
Expand Down
4 changes: 2 additions & 2 deletions backend/project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ object Dependencies {
"cats-kernel"
).map("org.typelevel" %% _ % Versions.cats)

val catsTagless = Seq("org.typelevel" %% "cats-tagless-macros" % "0.12")
val catsTagless = Seq("org.typelevel" %% "cats-tagless-macros" % "0.15.0")

val zio = Seq(
"dev.zio" %% "zio" % Versions.zio,
"dev.zio" %% "zio-managed" % Versions.zio,
"dev.zio" %% "zio-interop-cats" % "22.0.0.0",
"dev.zio" %% "zio-interop-cats" % "23.1.0.1",
"dev.zio" %% "zio-interop-twitter" % "21.2.0.2.2",
"dev.zio" %% "zio-test" % Versions.zio % Test,
"dev.zio" %% "zio-test-sbt" % Versions.zio % Test
Expand Down
2 changes: 1 addition & 1 deletion backend/project/Versions.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
object Versions {
val cats = "2.7.0"
val cats = "2.10.0"
val mongoScalaDriver = "4.4.0"
val tapir = "1.9.2"
val derevo = "0.13.0"
Expand Down

0 comments on commit 8a7d3f7

Please sign in to comment.