Move the initial housekeeping tick to the housekeeping thread.

This significantly reduces startup time.
This commit is contained in:
Victor Marmol 2014-09-03 21:45:57 -07:00
parent 9f0fb0432c
commit c692e9388d

View File

@ -53,10 +53,6 @@ type containerData struct {
}
func (c *containerData) Start() error {
// Force the first update.
c.housekeepingTick()
glog.Infof("Start housekeeping for container %q\n", c.info.Name)
go c.housekeeping()
return nil
}
@ -114,6 +110,10 @@ func (c *containerData) housekeeping() {
longHousekeeping = *HousekeepingInterval / 2
}
// Force the first update.
c.housekeepingTick()
glog.Infof("Start housekeeping for container %q\n", c.info.Name)
// Housekeep every second.
ticker := time.NewTicker(*HousekeepingInterval)
defer ticker.Stop()