cmd/syncthing: Avoid Keepalive/GUI refresh race

This avoids unnecessary browser request failures and retries. Eg:
- Browser reuses existing HTTP connection for GUI refresh request
- Server closes connection with request in flight
- Browser retries GET request.

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3854
This commit is contained in:
Mark Pulford 2017-01-01 12:38:31 +00:00 committed by Jakob Borg
parent 8e8b867fba
commit 69ae4aa024

View File

@ -327,7 +327,9 @@ func (s *apiService) Serve() {
srv := http.Server{ srv := http.Server{
Handler: handler, Handler: handler,
ReadTimeout: 10 * time.Second, // ReadTimeout must be longer than SyncthingController $scope.refresh
// interval to avoid HTTP keepalive/GUI refresh race.
ReadTimeout: 15 * time.Second,
} }
s.fss = newFolderSummaryService(s.cfg, s.model) s.fss = newFolderSummaryService(s.cfg, s.model)