Commit 3e9b06c8 authored by yanzg's avatar yanzg

修改实例化关系

parent 862f0283
...@@ -23,7 +23,7 @@ public class CacheLock implements Runnable { ...@@ -23,7 +23,7 @@ public class CacheLock implements Runnable {
private Cache cache; private Cache cache;
/** /**
* Redis 锁定时间(秒) * Redis 锁定时间(秒)
*/ */
private int lockTime; private int lockTime;
...@@ -127,7 +127,7 @@ public class CacheLock implements Runnable { ...@@ -127,7 +127,7 @@ public class CacheLock implements Runnable {
}; };
do { do {
// 开启唯一性锁,防止多人运行同一关键字的函数 // 开启唯一性锁,防止多人运行同一关键字的函数
cache.tryLockAndRun(key, lockTime, TimeUnit.MILLISECONDS, runnable); cache.tryLockAndRun(key, lockTime, TimeUnit.SECONDS, runnable);
// 假如没有运行,则等待50毫秒后继续运行 // 假如没有运行,则等待50毫秒后继续运行
if (!runFlag) { if (!runFlag) {
this.waitCount++; this.waitCount++;
......
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