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
63cf9379
Commit
63cf9379
authored
Feb 22, 2023
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
执行时间
parent
bbbf34b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
PlanInfo.java
...l-redis/src/main/java/com.yanzuoguang.redis/PlanInfo.java
+4
-5
No files found.
yzg-util-redis/src/main/java/com.yanzuoguang.redis/PlanInfo.java
View file @
63cf9379
...
@@ -100,7 +100,7 @@ public class PlanInfo<T> {
...
@@ -100,7 +100,7 @@ public class PlanInfo<T> {
* @param hour N小时
* @param hour N小时
* @return 下次执行间隔时间
* @return 下次执行间隔时间
*/
*/
public
int
getNextDayHourMillSecond
(
int
day
,
int
hour
)
{
public
long
getNextDayHourMillSecond
(
int
day
,
int
hour
)
{
return
getNextDayHourMillSecond
(
day
,
(
double
)
hour
);
return
getNextDayHourMillSecond
(
day
,
(
double
)
hour
);
}
}
...
@@ -111,9 +111,9 @@ public class PlanInfo<T> {
...
@@ -111,9 +111,9 @@ public class PlanInfo<T> {
* @param hour N小时
* @param hour N小时
* @return 下次执行间隔时间
* @return 下次执行间隔时间
*/
*/
public
int
getNextDayHourMillSecond
(
int
day
,
double
hour
)
{
public
long
getNextDayHourMillSecond
(
int
day
,
double
hour
)
{
if
(
this
.
getTime
()
==
0
)
{
if
(
this
.
getTime
()
==
0
)
{
return
60
;
return
60
L
;
}
}
// 上次执行时间
// 上次执行时间
Date
prevTime
=
new
Date
(
this
.
getTime
());
Date
prevTime
=
new
Date
(
this
.
getTime
());
...
@@ -122,8 +122,7 @@ public class PlanInfo<T> {
...
@@ -122,8 +122,7 @@ public class PlanInfo<T> {
Date
nextDay
=
DateHelper
.
addDay
(
DateHelper
.
getDateTime
(
prevToday
),
day
);
Date
nextDay
=
DateHelper
.
addDay
(
DateHelper
.
getDateTime
(
prevToday
),
day
);
Date
nextDayHour
=
DateHelper
.
addMinute
(
nextDay
,
(
int
)
(
hour
*
60
));
Date
nextDayHour
=
DateHelper
.
addMinute
(
nextDay
,
(
int
)
(
hour
*
60
));
// 下次执行时间
// 下次执行时间
long
dedTime
=
Math
.
max
(
0
,
nextDayHour
.
getTime
()
-
this
.
getTime
());
return
Math
.
max
(
0
,
nextDayHour
.
getTime
()
-
this
.
getTime
());
return
(
int
)
dedTime
;
}
}
public
long
getId
()
{
public
long
getId
()
{
...
...
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