diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-09-14 22:29:06 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-09-14 22:29:06 +0200 |
| commit | c03a72f1d7b598c1fe8fd01bb1f5bbfbd0256313 (patch) | |
| tree | a597236be7dfa01ce8c659ff8a478c86d70d09c2 /internal/engine/apply.go | |
| parent | 3315b98bd9bbd71f480280102188c33193d91728 (diff) | |
| download | krino-c03a72f1d7b598c1fe8fd01bb1f5bbfbd0256313.tar.gz krino-c03a72f1d7b598c1fe8fd01bb1f5bbfbd0256313.zip | |
plan 10: an interrupt stops between steps; nohup keeps ignoring hangups
Diffstat (limited to 'internal/engine/apply.go')
| -rw-r--r-- | internal/engine/apply.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/engine/apply.go b/internal/engine/apply.go index 75248fb..f9cb9ef 100644 --- a/internal/engine/apply.go +++ b/internal/engine/apply.go @@ -80,7 +80,7 @@ func (e *Engine) Apply(ctx context.Context, dp *DirPlan, approved map[string]boo if err := ctx.Err(); err != nil { return result, err } - fr, err := e.applyFile(dp.Dir.Name, c, approved[c.File.Rel], j, run) + fr, err := e.applyFile(ctx, dp.Dir.Name, c, approved[c.File.Rel], j, run) if err != nil { return result, fmt.Errorf("engine: apply: %w", err) } @@ -95,7 +95,7 @@ func (e *Engine) Apply(ctx context.Context, dp *DirPlan, approved map[string]boo } // applyFile carries out (or declines) one file's chain and logs it. -func (e *Engine) applyFile(dirName string, c plan.Chain, approved bool, j *journal.Writer, run string) (FileResult, error) { +func (e *Engine) applyFile(ctx context.Context, dirName string, c plan.Chain, approved bool, j *journal.Writer, run string) (FileResult, error) { rel := c.File.Rel if !approved { @@ -112,7 +112,7 @@ func (e *Engine) applyFile(dirName string, c plan.Chain, approved bool, j *journ // Each step is logged the moment it has run (review M9), not after the // whole chain: a run killed mid-chain must leave what it did undoable. - results, err := apply.ChainLogged(c, func(i int, sr apply.StepResult) error { + results, err := apply.ChainLogged(ctx, c, func(i int, sr apply.StepResult) error { if err := e.logStep(j, run, dirName, rel, i+1, c.Steps[i], sr); err != nil { return unloggedStep(rel, c.Steps[i], sr, err) } |
