GODT-2229: Own the full path for gluon and do not change Database path.

This commit is contained in:
Romain Le Jeune
2023-01-12 13:23:09 +00:00
committed by Leander Beernaert
parent 8d9db83a87
commit 0580842ad2
15 changed files with 285 additions and 72 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.GetGluonDir()), nil
return wrapperspb.String(s.bridge.GetGluonCacheDir()), 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.GetGluonDir() {
if path != s.bridge.GetGluonCacheDir() {
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.GetGluonDir()))
_ = s.SendEvent(NewDiskCachePathChangedEvent(s.bridge.GetGluonCacheDir()))
}
}()