-
Notifications
You must be signed in to change notification settings - Fork 45
redis加错未采用原子操作 #1
Copy link
Copy link
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or request
Description
Activity
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or request
这块redis操作,不是原子的,如果在设置过期时间前,突然宕机了,则加锁后的key将长时间存在,
应该用
Boolean setIfAbsent(K key, V value, long timeout, TimeUnit unit);