Skip to content

Commit

Permalink
update swap inittime compare with milli seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
jowenshaw committed Apr 26, 2021
1 parent c44884f commit be3380a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions worker/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,13 @@ func logWorkerTrace(job, subject string, context ...interface{}) {
log.Trace("["+job+"] "+subject, context...)
}

func getSepTimeInFind(dist int64) int64 {
// compare with "inittime" which is milli seconds
func getSepTimeInFind(distSeconds int64) (milliSeconds int64) {
nowTime := now()
if nowTime > dist {
return nowTime - dist
if nowTime > distSeconds {
milliSeconds = (nowTime - distSeconds) * 1000
}
return 0
return milliSeconds
}

func restInJob(duration time.Duration) {
Expand Down

0 comments on commit be3380a

Please sign in to comment.