mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-17 23:56:56 +00:00
GODT-1431 Prevent watcher when not using disk on cache
- change: Rename Cacher -> MsgCachePool - change: Do not run watcher when using memory cache - add: Allow to cancel cacher jobs (added context) - change: Fix behavior on context cancel (was causing no internet)
This commit is contained in:
@ -18,6 +18,7 @@
|
||||
package pmapi
|
||||
|
||||
import (
|
||||
"context"
|
||||
"math/rand"
|
||||
"net/http"
|
||||
"strconv"
|
||||
@ -141,6 +142,10 @@ func wrapNoConnection(res *resty.Response, err error) (*resty.Response, error) {
|
||||
return res, err
|
||||
}
|
||||
|
||||
if errors.Is(err, context.Canceled) {
|
||||
return res, err
|
||||
}
|
||||
|
||||
if res.RawResponse != nil {
|
||||
return res, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user