~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0
main
17 lines · 288 B Raw History
package runtime

import "time"

func Period(configured, fallback time.Duration) time.Duration {
	if configured == 0 {
		return fallback
	}
	return configured
}

func RefreshAfter(period time.Duration) Result {
	if period <= 0 {
		return Result{}
	}
	return Result{RequeueAfter: period}
}