mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -05:00
lock: Make some cleanup and moving the code around. (#2718)
This patch just avoids lot of ifs and inverts some logic.
This commit is contained in:
@@ -57,7 +57,7 @@ func (initialSnapShot LeakDetect) DetectLeak(t TestErrHandler) {
|
||||
}
|
||||
// Loop, waiting for goroutines to shut down.
|
||||
// Wait up to 5 seconds, but finish as quickly as possible.
|
||||
deadline := time.Now().Add(leakDetectDeadline * time.Second)
|
||||
deadline := time.Now().UTC().Add(leakDetectDeadline * time.Second)
|
||||
for {
|
||||
// get sack snapshot of relevant go routines.
|
||||
leaked := initialSnapShot.CompareCurrentSnapshot()
|
||||
@@ -66,7 +66,7 @@ func (initialSnapShot LeakDetect) DetectLeak(t TestErrHandler) {
|
||||
return
|
||||
}
|
||||
// wait a test again will deadline.
|
||||
if time.Now().Before(deadline) {
|
||||
if time.Now().UTC().Before(deadline) {
|
||||
time.Sleep(leakDetectPauseTimeMs * time.Millisecond)
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user