feat: add option to disable scheduled execution of a plan

This commit is contained in:
garethgeorge
2024-03-18 23:41:13 -07:00
committed by Gareth
parent 24afd514ad
commit aea74c51c0
15 changed files with 187 additions and 147 deletions

View File

@@ -107,10 +107,13 @@ func (s *BackrestHandler) AddRepo(ctx context.Context, req *connect.Request[v1.R
return nil, fmt.Errorf("failed to find or install restic binary: %w", err)
}
r := restic.NewRepo(bin, req.Msg)
r, err := orchestrator.NewRepoOrchestrator(req.Msg, bin)
if err != nil {
return nil, fmt.Errorf("failed to configure repo: %w", err)
}
// use background context such that the init op can try to complete even if the connection is closed.
if err := r.Init(context.Background(), restic.WithPropagatedEnvVars(restic.EnvToPropagate...)); err != nil {
if err := r.Init(context.Background()); err != nil {
return nil, fmt.Errorf("failed to init repo: %w", err)
}