Treat 502 and 503 errors from the LB as network errors so they get silenced and retried

This commit is contained in:
David Dworken 2022-10-15 10:12:18 -07:00
parent 0da8021ab7
commit 7f75f10b3f

View File

@ -972,7 +972,9 @@ func IsOfflineError(err error) bool {
return strings.Contains(err.Error(), "dial tcp: lookup api.hishtory.dev") ||
strings.Contains(err.Error(), "connect: network is unreachable") ||
strings.Contains(err.Error(), "read: connection reset by peer") ||
strings.Contains(err.Error(), ": EOF")
strings.Contains(err.Error(), ": EOF") ||
strings.Contains(err.Error(), ": status_code=502") ||
strings.Contains(err.Error(), ": status_code=503")
}
func ReliableDbCreate(db *gorm.DB, entry interface{}) error {