mirror of
https://github.com/garethgeorge/backrest.git
synced 2025-12-16 10:35:32 +00:00
fix: forget snapshot by ID should not require a plan
This commit is contained in:
@@ -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) {
|
func (s *BackrestHandler) Forget(ctx context.Context, req *connect.Request[v1.ForgetRequest]) (*connect.Response[emptypb.Empty], error) {
|
||||||
at := time.Now()
|
at := time.Now()
|
||||||
_, err := s.orchestrator.GetPlan(req.Msg.PlanId)
|
var err error
|
||||||
if err != nil {
|
|
||||||
return nil, fmt.Errorf("failed to get plan %q: %w", req.Msg.PlanId, err)
|
|
||||||
}
|
|
||||||
|
|
||||||
if req.Msg.SnapshotId != "" && req.Msg.PlanId != "" && req.Msg.RepoId != "" {
|
if req.Msg.SnapshotId != "" && req.Msg.PlanId != "" && req.Msg.RepoId != "" {
|
||||||
wait := make(chan struct{})
|
wait := make(chan struct{})
|
||||||
s.orchestrator.ScheduleTask(
|
s.orchestrator.ScheduleTask(
|
||||||
@@ -326,7 +322,6 @@ func (s *BackrestHandler) Forget(ctx context.Context, req *connect.Request[v1.Fo
|
|||||||
} else {
|
} else {
|
||||||
return nil, errors.New("must specify repoId and planId and (optionally) snapshotId")
|
return nil, errors.New("must specify repoId and planId and (optionally) snapshotId")
|
||||||
}
|
}
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user