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
1 changed files with 4 additions and 2 deletions

View File

@ -326,8 +326,10 @@ func (s *apiService) Serve() {
handler = debugMiddleware(handler)
srv := http.Server{
Handler: handler,
ReadTimeout: 10 * time.Second,
Handler: handler,
// 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)