14360: Cut excess time.Now() calls.
[arvados.git] / lib / dispatchcloud / worker / pool.go
index fc87ea42187c8268f72d311c82955d077a3504df..74d3d517295691bf9577d4c7fa9ec150489c4b32 100644 (file)
@@ -257,15 +257,16 @@ func (wp *Pool) updateWorker(inst cloud.Instance, it arvados.InstanceType, initi
                "Instance":     inst,
                "State":        initialState,
        }).Infof("instance appeared in cloud")
+       now := time.Now()
        wp.workers[id] = &worker{
                executor:    wp.newExecutor(inst),
                state:       initialState,
                instance:    inst,
                instType:    it,
-               probed:      time.Now(),
-               busy:        time.Now(),
-               updated:     time.Now(),
-               unallocated: time.Now(),
+               probed:      now,
+               busy:        now,
+               updated:     now,
+               unallocated: now,
                running:     make(map[string]struct{}),
                starting:    make(map[string]struct{}),
                probing:     make(chan struct{}, 1),