From c03a72f1d7b598c1fe8fd01bb1f5bbfbd0256313 Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Mon, 14 Sep 2026 22:29:06 +0200 Subject: plan 10: an interrupt stops between steps; nohup keeps ignoring hangups --- internal/engine/apply.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'internal/engine/apply.go') 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) } -- cgit v1.3