MCPcopy Index your code
hub / github.com/jetify-com/devbox / NeedsRun

Method NeedsRun

internal/setup/setup.go:54–54  ·  view source on GitHub ↗

NeedsRun returns true if the task needs to be run. It should assume that lastRun persists across executions of the program and is unique for each user. A task that should only run once can check if lastRun.Time is the zero value. A task that only runs after an update can check if lastRun.Version <

(ctx context.Context, lastRun RunInfo)

Source from the content-addressed store, hash-verified

52 // A task that only runs after an update can check if lastRun.Version < build.Version.
53 // A retryable task can check lastRun.Error to see if the previous run failed.
54 NeedsRun(ctx context.Context, lastRun RunInfo) bool
55}
56
57// RunInfo contains metadata that describes the most recent run of a task.

Callers 2

StatusFunction · 0.65
runFunction · 0.65

Implementers 2

testTaskinternal/setup/setup_test.go
setupTaskinternal/devbox/providers/nixcache/set

Calls

no outgoing calls

Tested by

no test coverage detected