From 49e46b04a06eb75829df2f97726d850749e29b74 Mon Sep 17 00:00:00 2001 From: garethgeorge Date: Sun, 21 Jul 2024 10:28:52 -0700 Subject: [PATCH] fix: forget snapshot by ID should not require a plan --- internal/api/backresthandler.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/internal/api/backresthandler.go b/internal/api/backresthandler.go index 1274925..ae53a72 100644 --- a/internal/api/backresthandler.go +++ b/internal/api/backresthandler.go @@ -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( @@ -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 }