From c692e9388d2397ad3bf9b5d8204e68e22e6dc484 Mon Sep 17 00:00:00 2001 From: Victor Marmol Date: Wed, 3 Sep 2014 21:45:57 -0700 Subject: [PATCH] Move the initial housekeeping tick to the housekeeping thread. This significantly reduces startup time. --- manager/container.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/manager/container.go b/manager/container.go index ea15fedf..68bbe081 100644 --- a/manager/container.go +++ b/manager/container.go @@ -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()