Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cmd/anvil/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9430,9 +9430,9 @@ func taskSubscriptionCmd(args []string) {
case "ls", "list":
taskSubscriptionLsCmd(args[1:])
case "pause":
taskSubscriptionPauseCmd(args[1:])
// taskSubscriptionPauseCmd(args[1:])
case "resume":
taskSubscriptionResumeCmd(args[1:])
// taskSubscriptionResumeCmd(args[1:])
default:
fmt.Fprintf(os.Stderr, "unknown subscription subcommand: %s\n", args[0])
fmt.Fprintf(os.Stderr, "Run 'anvil help' for more information.\n")
Expand Down
10 changes: 10 additions & 0 deletions internal/daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,16 @@ func (d *Daemon) runTask(workerID int, proj *project.Project, t project.Todo, sl
}
}

// Precondition check: if set, evaluate all conditions and skip if any fail.
// Both pre_check and precondition must pass for task to run.
if t.Precondition != nil {
if shouldProceed, skipReason := t.EvaluatePrecondition(proj.Path); !shouldProceed {
taskLabel := filepath.Base(proj.Path) + "/" + t.Name
dlog.Info("precondition skipped %s: %s", taskLabel, skipReason)
return
}
}

// Run the task with retry support
projName := filepath.Base(proj.Path)
taskLabel := projName + "/" + t.Name
Expand Down
Loading