记得上下班打卡 | git大法好,push需谨慎

Commit 128a2fc8 authored by 张国柄's avatar 张国柄

~api:藏品操作锁调整;

parent e7320f44
...@@ -2064,19 +2064,14 @@ public class GoblinRedisUtils { ...@@ -2064,19 +2064,14 @@ public class GoblinRedisUtils {
* 锁定藏品操作 * 锁定藏品操作
*/ */
public boolean lockUserDigitalArtworkVoOperate(String artworkId) { public boolean lockUserDigitalArtworkVoOperate(String artworkId) {
String lk = GoblinRedisConst.USER_DIGITAL_ARTWORK.concat("lk").concat(artworkId); return redisUtil.lock(GoblinRedisConst.USER_DIGITAL_ARTWORK.concat("lk").concat(artworkId), 1, 30);
if (redisUtil.incr(lk, 1) > 1) {
return false;
}
redisUtil.expireSet(lk, 30);
return true;
} }
/** /**
* 解锁藏品操作 * 解锁藏品操作
*/ */
public void unlockUserDigitalArtworkVoOperate(String artworkId) { public void unlockUserDigitalArtworkVoOperate(String artworkId) {
redisUtil.del(GoblinRedisConst.USER_DIGITAL_ARTWORK.concat("lk").concat(artworkId)); redisUtil.uLock(GoblinRedisConst.USER_DIGITAL_ARTWORK.concat("lk").concat(artworkId));
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment