Skip to content

Commit d87fcc9

Browse files
committed
Trying async cache for DelegatedExpressionHandler
1 parent 2158be4 commit d87fcc9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/math/DelegatedExpressionHandler.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ class DelegatedExpressionHandler(
1212
) : ExpressionHandler {
1313
private val evaluationCache: Cache<Int, Double?> = Caffeine.newBuilder()
1414
.expireAfterWrite(plugin.configYml.getInt("math-cache-ttl").toLong(), TimeUnit.MILLISECONDS)
15-
.build()
15+
.buildAsync<Int, Double?>()
16+
.synchronous()
1617

1718
override fun evaluate(expression: String, context: PlaceholderContext): Double? {
1819
expression.fastToDoubleOrNull()?.let { return it }

0 commit comments

Comments
 (0)