feat(GODT-2385): Gluon cache fallback

Update Gluon to have access to the cache fallback reader.

Provide fallback reader to handle old cache file format.

Remove the old logic to erase all cache files on start as the fallback
option renders this irrelevant.
This commit is contained in:
Leander Beernaert
2023-02-22 11:55:03 +01:00
parent 4775fb4b22
commit 5007d451c2
4 changed files with 5 additions and 15 deletions

View File

@ -31,6 +31,7 @@ import (
"github.com/ProtonMail/gluon/imap"
"github.com/ProtonMail/gluon/reporter"
"github.com/ProtonMail/gluon/store"
"github.com/ProtonMail/gluon/store/fallback_v0"
"github.com/ProtonMail/proton-bridge/v3/internal/async"
"github.com/ProtonMail/proton-bridge/v3/internal/constants"
"github.com/ProtonMail/proton-bridge/v3/internal/events"
@ -377,6 +378,7 @@ func (*storeBuilder) New(path, userID string, passphrase []byte) (store.Store, e
return store.NewOnDiskStore(
filepath.Join(path, userID),
passphrase,
store.WithFallback(fallback_v0.NewOnDiskStoreV0WithCompressor(&fallback_v0.GZipCompressor{})),
)
}