Revert "GODT-2229: Allow changing cache folder to a non-empty folder."

This reverts commit b19e16e4b8.
This commit is contained in:
Jakub
2023-01-11 10:19:38 +01:00
parent 606a8f134d
commit 715efaa087
15 changed files with 63 additions and 187 deletions

View File

@ -591,7 +591,7 @@ func (s *Service) IsAutomaticUpdateOn(ctx context.Context, _ *emptypb.Empty) (*w
func (s *Service) DiskCachePath(ctx context.Context, _ *emptypb.Empty) (*wrapperspb.StringValue, error) {
s.log.Debug("DiskCachePath")
return wrapperspb.String(s.bridge.GetGluonCacheDir()), nil
return wrapperspb.String(s.bridge.GetGluonDir()), nil
}
func (s *Service) SetDiskCachePath(ctx context.Context, newPath *wrapperspb.StringValue) (*emptypb.Empty, error) {
@ -609,14 +609,14 @@ func (s *Service) SetDiskCachePath(ctx context.Context, newPath *wrapperspb.Stri
path = path[1:]
}
if path != s.bridge.GetGluonCacheDir() {
if path != s.bridge.GetGluonDir() {
if err := s.bridge.SetGluonDir(context.Background(), path); err != nil {
s.log.WithError(err).Error("The local cache location could not be changed.")
_ = s.SendEvent(NewDiskCacheErrorEvent(DiskCacheErrorType_CANT_MOVE_DISK_CACHE_ERROR))
return
}
_ = s.SendEvent(NewDiskCachePathChangedEvent(s.bridge.GetGluonCacheDir()))
_ = s.SendEvent(NewDiskCachePathChangedEvent(s.bridge.GetGluonDir()))
}
}()