Skip to content

Commit

Permalink
Set ping timeout
Browse files Browse the repository at this point in the history
Signed-off-by: Pablo Chico de Guzman <pchico83@gmail.com>
  • Loading branch information
pchico83 committed Oct 28, 2020
1 parent a429000 commit e837dde
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/syncthing/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (s *Syncthing) callWithRetry(ctx context.Context, url, method string, code
} else {
urlPath = path.Join(s.RemoteGUIAddress, url)
s.Client.Timeout = 25 * time.Second
if url == "rest/db/ignores" {
if url == "rest/db/ignores" || url == "rest/system/ping" {
s.Client.Timeout = 5 * time.Second
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/syncthing/syncthing.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ func (s *Syncthing) WaitForPing(ctx context.Context, local bool) error {

//Ping checks if syncthing is available
func (s *Syncthing) Ping(ctx context.Context, local bool) bool {
_, err := s.APICall(ctx, "rest/system/ping", "GET", 200, nil, local, nil, false, 3)
_, err := s.APICall(ctx, "rest/system/ping", "GET", 200, nil, local, nil, false, 1)
return err == nil
}

Expand Down

0 comments on commit e837dde

Please sign in to comment.