Skip to content

Commit

Permalink
Bug fix for memcached
Browse files Browse the repository at this point in the history
  • Loading branch information
UnknownJoe796 committed Oct 9, 2023
1 parent 33a7cdc commit 743e720
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class MemcachedCache(val client: MemcachedClient) : Cache, HealthCheckable {
}

override suspend fun add(key: String, value: Int, timeToLive: Duration?) = withContext(Dispatchers.IO) {
client.incr(key, value.toLong())
client.incr(key, value.toLong(), value.toLong())
timeToLive?.let {
//TODO
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ abstract class CacheTest {

cache.remove(key)
cache.add(key, 1)
assertEquals(1, cache.get<Int>(key))
cache.add(key, 1)
assertEquals(2, cache.get<Int>(key))
}
}

Expand Down

0 comments on commit 743e720

Please sign in to comment.