Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ af0d992acdc6d49705be09ede6f08fdf03455c02

# Scala Steward: Reformat with scalafmt 3.6.1
fb151ecf9ca6384e2f67c536f991f2dcdb197b22

# Scala Steward: Reformat with scalafmt 3.9.10
68909e3d1e28d4088edfc6934d26eddb62b2f507
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = 3.6.1
version = 3.9.10
runner.dialect = Scala213
align {
preset = more
Expand Down
6 changes: 3 additions & 3 deletions src/main/scala/com/stuart/zcaffeine/ZCaffeine.scala
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ object ZCaffeine {
caffeine: => Caffeine[Key, Value]
): URIO[R, ZCaffeine[R, Unconfigured, Key, Value]] =
for {
executor <- ZIO.executor
runtime <- ZIO.runtime[R]
executor <- ZIO.executor
runtime <- ZIO.runtime[R]
configured = ZIO.attempt(
caffeine
.executor(executor.asJava)
Expand Down Expand Up @@ -278,7 +278,7 @@ class ZCaffeine[R, S <: State, Key, Value] private (
): CompletableFuture[util.Map[Key, Value]] = zioToCompletableFuture(runtime) {
loadAll match {
case Some(f) => f(keys.asScala.toSet).map(_.asJava)
case None =>
case None =>
ZIO
.foreach(keys.asScala.toSet)(key => loadOne(key).map(key -> _))
.map(_.toMap[Key, Value].asJava)
Expand Down
2 changes: 1 addition & 1 deletion src/test/scala/com/stuart/zcaffeine/LoadingCacheSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ object LoadingCacheSpec extends ZIOSpecDefault {
test("get/getAll/refresh/refreshAll") {
for {
zcaffeine <- ZCaffeine[TestEnvironment, String, String]()
cache <- zcaffeine.build(
cache <- zcaffeine.build(
loadOne = key => ZIO.succeed(s"loadOne: $key"),
loadAll = Some(keys => ZIO.succeed(keys.map(key => key -> s"loadAll: $key").toMap)),
reloadOne = Some((key, value) => ZIO.succeed(s"""reloadOne: $key (old: "$value")"""))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ object RemovalListenerSpec extends ZIOSpecDefault {
for {
evictedKeys <- Ref.make(List.empty[String])
zcaffeine <- ZCaffeine[TestEnvironment, String, Int]()
cache <- zcaffeine
cache <- zcaffeine
.enableScheduling()
.removalListener((key, _, _) => evictedKeys.update(key :: _))
.build()
Expand Down
Loading