2
0

add prefer-standby target_session_attrs

This commit is contained in:
sergey.bashilov
2022-06-17 14:51:56 +03:00
committed by Jack Christensen
parent 7ddbd74d5e
commit 25935a39b6
4 changed files with 90 additions and 30 deletions
+17
View File
@@ -219,3 +219,20 @@ func redactURL(u *url.URL) string {
}
return u.String()
}
type preferStanbyNotFoundError struct {
err error
safeToRetry bool
}
func (e *preferStanbyNotFoundError) Error() string {
return fmt.Sprintf("standby server not found: %s", e.err.Error())
}
func (e *preferStanbyNotFoundError) SafeToRetry() bool {
return e.safeToRetry
}
func (e *preferStanbyNotFoundError) Unwrap() error {
return e.err
}