Skip to content

Commit

Permalink
fix: forget snapshot by ID should not require a plan
Browse files Browse the repository at this point in the history
  • Loading branch information
garethgeorge committed Jul 21, 2024
1 parent f250adf commit 49e46b0
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions internal/api/backresthandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,11 +300,7 @@ func (s *BackrestHandler) Backup(ctx context.Context, req *connect.Request[types

func (s *BackrestHandler) Forget(ctx context.Context, req *connect.Request[v1.ForgetRequest]) (*connect.Response[emptypb.Empty], error) {
at := time.Now()
_, err := s.orchestrator.GetPlan(req.Msg.PlanId)
if err != nil {
return nil, fmt.Errorf("failed to get plan %q: %w", req.Msg.PlanId, err)
}

var err error
if req.Msg.SnapshotId != "" && req.Msg.PlanId != "" && req.Msg.RepoId != "" {
wait := make(chan struct{})
s.orchestrator.ScheduleTask(
Expand All @@ -326,7 +322,6 @@ func (s *BackrestHandler) Forget(ctx context.Context, req *connect.Request[v1.Fo
} else {
return nil, errors.New("must specify repoId and planId and (optionally) snapshotId")
}

if err != nil {
return nil, err
}
Expand Down

0 comments on commit 49e46b0

Please sign in to comment.