mirror of
https://github.com/ddworken/hishtory.git
synced 2025-08-10 07:27:57 +02:00
Add support for running hishtory redact while offline, even though this may lead to syncing inconsistency bugs
This commit is contained in:
@ -569,7 +569,7 @@ func IsOfflineError(ctx context.Context, err error) bool {
|
||||
strings.Contains(err.Error(), "connect: connection refused") {
|
||||
return true
|
||||
}
|
||||
if !isHishtoryServerUp(ctx) {
|
||||
if !CanReachHishtoryServer(ctx) {
|
||||
// If the backend server is down, then treat all errors as offline errors
|
||||
return true
|
||||
}
|
||||
@ -577,7 +577,7 @@ func IsOfflineError(ctx context.Context, err error) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func isHishtoryServerUp(ctx context.Context) bool {
|
||||
func CanReachHishtoryServer(ctx context.Context) bool {
|
||||
_, err := ApiGet(ctx, "/api/v1/ping")
|
||||
return err == nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user