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
b7799941
Commit
b7799941
authored
Sep 20, 2022
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
升级新版本
parent
95d52d47
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
YzgTimeout.java
...src/main/java/com/yanzuoguang/util/helper/YzgTimeout.java
+13
-2
No files found.
yzg-util-base/src/main/java/com/yanzuoguang/util/helper/YzgTimeout.java
View file @
b7799941
...
...
@@ -85,6 +85,10 @@ public class YzgTimeout {
}
private
static
void
init
()
{
if
(
executorService
!=
null
)
{
return
;
}
synchronized
(
YzgTimeout
.
class
)
{
if
(
executorService
!=
null
)
{
return
;
...
...
@@ -95,8 +99,12 @@ public class YzgTimeout {
ThreadHelper
.
runThread
(()
->
{
while
(
true
)
{
try
{
runItem
();
ThreadHelper
.
sleep
(
1000
);
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
}
ThreadHelper
.
sleep
(
200
);
}
});
}
...
...
@@ -112,6 +120,9 @@ public class YzgTimeout {
synchronized
(
queueInfos
)
{
poll
=
queueInfos
.
poll
();
}
if
(
poll
==
null
)
{
return
;
}
long
end
=
System
.
currentTimeMillis
();
long
time
=
end
-
poll
.
getStart
();
if
(
time
>
poll
.
getTimeMax
())
{
...
...
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