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
@@ -1,2 +1,5 @@
# Scala Steward: Reformat with scalafmt 3.9.10
55ec8dec7644ed9ff070984aa46ac0496638ac26

# Scala Steward: Reformat with scalafmt 3.11.1
c58594fa13578e12337098fc7c61b16175294616
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

version = 3.9.10
version = 3.11.1
runner.dialect = scala3
docstrings.style = keep

Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ lazy val root = project
name := "valkey4cats",
publish / skip := true
)
.aggregate(core, effects, log4Cats, examples)
.aggregate(core, effects, log4Cats, examples)

lazy val core = project
.in(file("modules/core"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ sealed trait CacheEvictionPolicy {

object CacheEvictionPolicy {
case object LRU extends CacheEvictionPolicy {
private[valkey4cats] def toGlide: GlideEvictionPolicy = GlideEvictionPolicy.LRU
private[valkey4cats] def toGlide: GlideEvictionPolicy =
GlideEvictionPolicy.LRU
}
case object LFU extends CacheEvictionPolicy {
private[valkey4cats] def toGlide: GlideEvictionPolicy = GlideEvictionPolicy.LFU
private[valkey4cats] def toGlide: GlideEvictionPolicy =
GlideEvictionPolicy.LFU
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ object ClientSideCacheConfig {
enableMetrics: Boolean = false
): Either[String, ClientSideCacheConfig] =
if (maxCacheKb <= 0) Left("maxCacheKb must be positive")
else if (entryTtl.toMillis <= 0) Left("entryTtl must be at least 1 millisecond")
else if (entryTtl.toMillis <= 0)
Left("entryTtl must be at least 1 millisecond")
else Right(Impl(maxCacheKb, entryTtl, evictionPolicy, enableMetrics))

def make[F[_]: ApplicativeThrow](
Expand All @@ -61,7 +62,8 @@ object ClientSideCacheConfig {
enableMetrics: Boolean = false
): F[ClientSideCacheConfig] =
ApplicativeThrow[F].fromEither(
apply(maxCacheKb, entryTtl, evictionPolicy, enableMetrics)
.left.map(msg => new IllegalArgumentException(msg))
apply(maxCacheKb, entryTtl, evictionPolicy, enableMetrics).left.map(msg =>
new IllegalArgumentException(msg)
)
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ object ValkeyClusterConfig {
private def validateConsistentUris(
uris: List[ValkeyUri]
): Either[String, ValkeyUri] = uris match {
case Nil => Left("No URIs provided")
case Nil => Left("No URIs provided")
case first :: rest =>
rest.find(!first.isConsistentWith(_)) match {
case Some(uri) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3587,10 +3587,13 @@ private[valkey4cats] abstract class BaseValkey[F[_]: MkValkey, K, V](

}

private[valkey4cats] trait CacheMetricsImpl[F[_], K, V] extends CachedValkeyCommands[F, K, V] {
private[valkey4cats] trait CacheMetricsImpl[F[_], K, V]
extends CachedValkeyCommands[F, K, V] {
self: BaseValkey[F, K, V] =>

private def liftAndMap[A, B](cf: java.util.concurrent.CompletableFuture[A])(f: A => B): F[B] =
private def liftAndMap[A, B](cf: java.util.concurrent.CompletableFuture[A])(
f: A => B
): F[B] =
asyncF.map(futureLift.lift(cf))(f)

override def cacheHitRate: F[Double] =
Expand Down
12 changes: 6 additions & 6 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.4")

ThisBuild / libraryDependencySchemes += "org.scala-lang.modules" %% "scala-xml" % VersionScheme.Always

addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.5")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.11.2")
addSbtPlugin("org.typelevel" % "sbt-tpolecat" % "0.5.4")
addSbtPlugin("com.github.sbt" % "sbt-header" % "5.11.0")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.6.1")
addSbtPlugin("com.scalapenos" % "sbt-prompt" % "2.0.0")
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.5")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.11.2")
addSbtPlugin("org.typelevel" % "sbt-tpolecat" % "0.5.4")
addSbtPlugin("com.github.sbt" % "sbt-header" % "5.11.0")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.6.1")
addSbtPlugin("com.scalapenos" % "sbt-prompt" % "2.0.0")
Loading