mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-18 16:17:03 +00:00
GODT-2251: Store gluon DB in user config rather than cache directory
Gluon data was stored in the user's "data dir". This is ~/.local/share on linux, but was the user's "cache dir" on windows/mac. As a result, it would sometimes be deleted to reclaim disk space. This change ensures the "data dir" is persistent on windows/mac.
This commit is contained in:
@ -96,7 +96,7 @@ func (p *DefaultProvider) UserCache() string {
|
|||||||
// On non-linux systems, it is the same as os.UserConfigDir().
|
// On non-linux systems, it is the same as os.UserConfigDir().
|
||||||
func userDataDir() (string, error) {
|
func userDataDir() (string, error) {
|
||||||
if runtime.GOOS != "linux" {
|
if runtime.GOOS != "linux" {
|
||||||
return os.UserCacheDir()
|
return os.UserConfigDir()
|
||||||
}
|
}
|
||||||
|
|
||||||
if dir := os.Getenv("XDG_DATA_HOME"); dir != "" {
|
if dir := os.Getenv("XDG_DATA_HOME"); dir != "" {
|
||||||
|
|||||||
Reference in New Issue
Block a user