github.com/wallyworld/juju@v0.0.0-20161013125918-6cf1bc9d917a/worker/uniter/timer.go (about)

     1  // Copyright 2015 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package uniter
     5  
     6  import (
     7  	"time"
     8  )
     9  
    10  const (
    11  	// interval at which the unit's status should be polled
    12  	statusPollInterval = 5 * time.Minute
    13  )
    14  
    15  // updateStatusSignal returns a time channel that fires after a given interval.
    16  func updateStatusSignal() <-chan time.Time {
    17  	// TODO(fwereade): 2016-03-17 lp:1558657
    18  	return time.After(statusPollInterval)
    19  }
    20  
    21  // NewUpdateStatusTimer returns a timed signal suitable for update-status hook.
    22  func NewUpdateStatusTimer() func() <-chan time.Time {
    23  	return updateStatusSignal
    24  }