Skip to main content

run_task_ctx_cleanup

Function run_task_ctx_cleanup 

Source
pub fn run_task_ctx_cleanup(
    command: &CleanupCommand,
    env: &BTreeMap<String, String>,
    version: &str,
    out: &mut impl Write,
) -> Result<(), String>
Expand description

Runs schedr task-ctx cleanup add|list: registers a handle before the work it cleans up after, or, in a cleanup, prints the attempt’s handles in registration order: one line of JSON each, or with --field one field’s raw value each; the error is the message for stderr.

§Errors

Outside a task, when the channel is gone, when a field or --json can’t be read, when the agent refuses the handle (no cleanup declared, a type not declared, too large, already in the cleanup) or the list (not in a cleanup), or when a handle lacks the field asked for.