Skip to content

Commit 26179c4

Browse files
authored
feat(server): refresh cache entries after an hour on stale request instead of expiring them completely (#1910)
1 parent ee4a510 commit 26179c4

File tree

1 file changed

+2
-2
lines changed
  • jit-binding-server/src/main/kotlin/io/github/typesafegithub/workflows/jitbindingserver

1 file changed

+2
-2
lines changed

jit-binding-server/src/main/kotlin/io/github/typesafegithub/workflows/jitbindingserver/ArtifactRoutes.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package io.github.typesafegithub.workflows.jitbindingserver
22

33
import com.github.benmanes.caffeine.cache.Caffeine
44
import com.sksamuel.aedile.core.asLoadingCache
5-
import com.sksamuel.aedile.core.expireAfterWrite
5+
import com.sksamuel.aedile.core.refreshAfterWrite
66
import io.github.oshai.kotlinlogging.KotlinLogging.logger
77
import io.github.typesafegithub.workflows.actionbindinggenerator.domain.ActionCoords
88
import io.github.typesafegithub.workflows.actionbindinggenerator.domain.prettyPrint
@@ -33,7 +33,7 @@ typealias ArtifactResult = Result<Map<String, Artifact>>
3333
private val bindingsCache =
3434
Caffeine
3535
.newBuilder()
36-
.expireAfterWrite(1.hours)
36+
.refreshAfterWrite(1.hours)
3737
.recordStats()
3838
.asLoadingCache<ActionCoords, ArtifactResult> { runCatching { it.buildVersionArtifacts()!! } }
3939

0 commit comments

Comments
 (0)