Skip to content

Commit

Permalink
redis-delay-task
Browse files Browse the repository at this point in the history
  • Loading branch information
nealmind committed Aug 13, 2020
1 parent a27026e commit 330cee1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions _posts/2020-08-13-redis-delay-task.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ author: neal
* **存数据:** `ZADD [key] [member] [score]`
* **查询分数:** `ZSCORE [key] [member]`









使用springboot的StringRedisTemplate实现;
由于score是double,返回时由于时间戳过长会转成 科学计数法,需要用`BigDecimal`转化一下;
因为业务上存在更新延时任务的情况,需要在更新score时进行判断,当前值小于原值时才进行更新,
Expand Down

0 comments on commit 330cee1

Please sign in to comment.