Skip to content
This repository has been archived by the owner on Jan 27, 2020. It is now read-only.

Commit

Permalink
Catch /rest/events timeout (fixes #44)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zillode committed Apr 19, 2015
1 parent a528d6c commit 4824f96
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion syncwatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ var (

// HTTP Timeouts
var (
requestTimeout = 30 * time.Second
requestTimeout = 180 * time.Second
)

// HTTP Debounce
Expand Down Expand Up @@ -688,6 +688,11 @@ func watchSTEvents(stChans map[string]chan STEvent, folders []FolderConfiguratio
for {
events, err := getSTEvents(lastSeenID)
if err != nil {
// Work-around for Go <1.5 (https://github.com/golang/go/issues/9405)
if strings.Contains(err.Error(), "use of closed network connection") {
continue
}

// Syncthing probably restarted
Debug.Println("Resetting STEvents", err)
lastSeenID = 0
Expand Down

0 comments on commit 4824f96

Please sign in to comment.