this patch fixes "high cpu consumption without sleeping in housekeeping()" problem if system time has changed

Signed-off-by: Jin-Hwan Jeong <jhjeong.kr@gmail.com>
This commit is contained in:
Jin-Hwan Jeong 2015-08-18 09:03:12 +09:00
parent 9db0c2e26f
commit 9bb7a0278d

View File

@ -416,6 +416,8 @@ func (c *containerData) housekeeping() {
// Schedule the next housekeeping. Sleep until that time.
if time.Now().Before(next) {
time.Sleep(next.Sub(time.Now()))
} else {
next = time.Now()
}
lastHousekeeping = next
}