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

@@ -5,6 +5,7 @@ import (
"net/http"
"reflect"
"strings"
"time"
"github.com/docker/cli/cli/connhelper"
"github.com/docker/docker/api/types"
@@ -197,6 +198,7 @@ func (p *Provider) grWatchDockerChanges() {
p.BuildStartRoutes()
case err := <-errChan:
p.Logf("Event", "error %s", err)
time.Sleep(100 * time.Millisecond)
msgChan, errChan = p.dockerClient.Events(context.Background(), types.EventsOptions{Filters: filter})
}
}