131
131
// runLoop repeatedly calls runOnce until it returns worker.ErrTerminateAgent
132
132
// or an upgraded error, or a value is received on stop.
133
133
func runLoop(runOnce func() error, stop <-chan struct{}) error {
137
137
if err == worker.ErrTerminateAgent {
149
149
if !isleep(retryDelay, stop) {