mirror of
https://github.com/ddworken/hishtory.git
synced 2025-06-21 04:17:45 +02:00
Treat EOF error as an offline error
This commit is contained in:
parent
c190b80837
commit
5a38a4a754
@ -938,7 +938,7 @@ func ApiPost(path, contentType string, data []byte) ([]byte, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func IsOfflineError(err error) bool {
|
func IsOfflineError(err error) bool {
|
||||||
return strings.Contains(err.Error(), "dial tcp: lookup api.hishtory.dev") || strings.Contains(err.Error(), "read: connection reset by peer")
|
return strings.Contains(err.Error(), "dial tcp: lookup api.hishtory.dev") || strings.Contains(err.Error(), "read: connection reset by peer") || strings.Contains(err.Error(), ": EOF")
|
||||||
}
|
}
|
||||||
|
|
||||||
func ReliableDbCreate(db *gorm.DB, entry interface{}) error {
|
func ReliableDbCreate(db *gorm.DB, entry interface{}) error {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user