Skip to content

Commit

Permalink
[feat] change redis command of set store
Browse files Browse the repository at this point in the history
  • Loading branch information
dojinyou committed Nov 19, 2023
1 parent 42194ec commit b109c33
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ class PopularStoreCacheService(

fun setStore(key: String, storeId: Long) {
val ops = redisTemplate.opsForZSet()
val count = ops.score(key, storeId) ?: 0.0
ops.add(key, storeId.toString(), count + 1)
ops.incrementScore(key, storeId.toString(), 1.0)
}

/**
Expand Down

0 comments on commit b109c33

Please sign in to comment.