Add emergency repository unlock
This commit is contained in:
@@ -414,6 +414,19 @@ func (s *Service) UnlockRepository(ctx context.Context, repoID string) error {
|
||||
return s.restic.Unlock(ctx, mounted.Repository)
|
||||
}
|
||||
|
||||
func (s *Service) ForceUnlockRepository(ctx context.Context, repoID string) error {
|
||||
repo, ok := s.repository(repoID)
|
||||
if !ok {
|
||||
return errors.New("validation: unknown repository")
|
||||
}
|
||||
mounted, err := s.mounts.Prepare(ctx, repo)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer s.mounts.Cleanup(context.Background(), mounted)
|
||||
return s.restic.ForceUnlock(ctx, mounted.Repository)
|
||||
}
|
||||
|
||||
func (s *Service) execute(ctx context.Context, run model.Run) model.Run {
|
||||
ctx = restic.WithRunID(ctx, run.ID)
|
||||
if run.TaskType == "backup" {
|
||||
|
||||
Reference in New Issue
Block a user