Move the initial housekeeping tick to the housekeeping thread.
This significantly reduces startup time.
This commit is contained in:
parent
9f0fb0432c
commit
c692e9388d
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user