Determines whether a task needs to be rerun by checking:
Task file modifications (file hash comparison)
Dependency file modifications (extracted from source() calls)
Cohort generation changes (hash comparison in database)
Previous run errors (checked in logs and history)
Version changes
Usage
shouldRerunTask(
taskFile,
configBlock,
executionSettings,
pipelineVersion,
tasksFolderPath = here::here("analysis/tasks")
)Arguments
- taskFile
Character. Name or path of the task file (e.g., "task1.R")
- configBlock
Character. The config block name (e.g., "optum_dod")
- executionSettings
ExecutionSettings object
- pipelineVersion
Character. Current pipeline version (e.g., "1.0.0")
- tasksFolderPath
Character. Path to tasks folder (default: here::here("analysis/tasks"))
Value
List with elements:
should_rerun: Logical. TRUE if task should be rerun
reasons: Character vector. Why task should be rerun
last_run_info: List with previous run details (time, version, status)
task_file_hash: Current hash of task file
cohort_hash_status: List comparing manifest hashes to database hashes