add delay after error while watching change fix

This commit is contained in:
yusing
2024-03-12 20:33:59 +00:00
parent 0aef8f2931
commit a0f890fed7
4 changed files with 4 additions and 11 deletions

View File

@@ -3,6 +3,7 @@ package main
import (
"fmt"
"os"
"time"
"github.com/fsnotify/fsnotify"
"gopkg.in/yaml.v3"
@@ -69,6 +70,7 @@ func (p *Provider) grWatchFileChanges() {
p.StopAllRoutes()
}
case err := <-watcher.Errors:
time.Sleep(100 * time.Millisecond)
p.Errorf("Watcher", "File watcher error: %s", p.name, err)
}
}