proxy: Add try_duration and try_interval; by default don't retry

This commit is contained in:
Matthew Holt 2016-09-24 16:03:22 -06:00
parent 9b9a77a160
commit 37f05e450f
No known key found for this signature in database
GPG key ID: 0D97CC73664F4D03
3 changed files with 80 additions and 28 deletions

View file

@ -766,9 +766,9 @@ func (u *fakeUpstream) Select(r *http.Request) *UpstreamHost {
return u.host
}
func (u *fakeUpstream) AllowedPath(requestPath string) bool {
return true
}
func (u *fakeUpstream) AllowedPath(requestPath string) bool { return true }
func (u *fakeUpstream) GetTryDuration() time.Duration { return 1 * time.Second }
func (u *fakeUpstream) GetTryInterval() time.Duration { return 250 * time.Millisecond }
// newWebSocketTestProxy returns a test proxy that will
// redirect to the specified backendAddr. The function
@ -808,9 +808,9 @@ func (u *fakeWsUpstream) Select(r *http.Request) *UpstreamHost {
}
}
func (u *fakeWsUpstream) AllowedPath(requestPath string) bool {
return true
}
func (u *fakeWsUpstream) AllowedPath(requestPath string) bool { return true }
func (u *fakeWsUpstream) GetTryDuration() time.Duration { return 1 * time.Second }
func (u *fakeWsUpstream) GetTryInterval() time.Duration { return 250 * time.Millisecond }
// recorderHijacker is a ResponseRecorder that can
// be hijacked.