summaryrefslogtreecommitdiff
path: root/recording
diff options
context:
space:
mode:
authorKeuin <[email protected]>2023-06-01 21:55:56 +0800
committerKeuin <[email protected]>2023-07-29 20:16:08 +0800
commit0da1d6d8107f8619aa53f80e14b2cc1bc10ce2ae (patch)
tree8d9cf06a9c900acdc3467306f22a81c3f46170a4 /recording
parent49082656b79cea1d5ea21fe92564eaddd9b5843a (diff)
Cool down before restarting from errors.
Diffstat (limited to 'recording')
-rw-r--r--recording/runner.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/recording/runner.go b/recording/runner.go
index fcb135e..c724735 100644
--- a/recording/runner.go
+++ b/recording/runner.go
@@ -119,6 +119,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(
@@ -156,6 +159,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.")
}