Skip to content

Commit

Permalink
Add a nil check for getting items from redis
Browse files Browse the repository at this point in the history
  • Loading branch information
bombies committed Sep 16, 2023
1 parent c7bcfa1 commit 90a46a4
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ abstract class RedisCache protected constructor(cacheID: String) {

protected open suspend fun get(identifier: String): String? = coroutineScope {
val item = jedis.get(cacheID + identifier)
return@coroutineScope item.ifBlank { null }
return@coroutineScope if (item == "nil") null else item
}

protected open suspend fun get(identifier: Long): String? {
Expand Down

0 comments on commit 90a46a4

Please sign in to comment.