summaryrefslogtreecommitdiff
path: root/recording/runner.go
diff options
context:
space:
mode:
authorKeuin <[email protected]>2023-06-01 21:55:56 +0800
committerKeuin <[email protected]>2023-06-01 21:55:56 +0800
commit32b2049179e1cc060700c4f609cb4214644ac232 (patch)
tree93021774381fb8d95545b2796216aa0890f720d1 /recording/runner.go
parent6c3c988bae6f8a78afd3503743106395792ee2b0 (diff)
Cool down before restarting from errors.restart-cooldown
Diffstat (limited to 'recording/runner.go')
-rw-r--r--recording/runner.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/recording/runner.go b/recording/runner.go
index f12e9cd..e401eb0 100644
--- a/recording/runner.go
+++ b/recording/runner.go
@@ -115,6 +115,9 @@ func tryRunTask(t *RunningTask) error {
var err error
defer wg.Done()
run := true
+ cd := common.CoolDown{
+ MinInterval: time.Second * 10,
+ }
loop:
for run {
err = watch(
@@ -150,6 +153,7 @@ func tryRunTask(t *RunningTask) error {
}
if run {
t.logger.Info("Restarting watcher...")
+ cd.Tick()
} else {
t.logger.Error("Cannot restart watcher to recover from that error.")
}