Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yzg-util
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
YZG
yzg-util
Commits
3e9b06c8
Commit
3e9b06c8
authored
Nov 02, 2021
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改实例化关系
parent
862f0283
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
CacheLock.java
...-redis/src/main/java/com.yanzuoguang.redis/CacheLock.java
+2
-2
No files found.
yzg-util-redis/src/main/java/com.yanzuoguang.redis/CacheLock.java
View file @
3e9b06c8
...
@@ -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
.
MILLI
SECONDS
,
runnable
);
cache
.
tryLockAndRun
(
key
,
lockTime
,
TimeUnit
.
SECONDS
,
runnable
);
// 假如没有运行,则等待50毫秒后继续运行
// 假如没有运行,则等待50毫秒后继续运行
if
(!
runFlag
)
{
if
(!
runFlag
)
{
this
.
waitCount
++;
this
.
waitCount
++;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment