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)
| 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. |