MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / scheduler_record_log_fields

Function scheduler_record_log_fields

src/daemon.rs:706–734  ·  view source on GitHub ↗
(
    project_path: &Path,
    record: &crate::automation::run_ledger::AutomationRunLedgerRecord,
)

Source from the content-addressed store, hash-verified

704
705#[cfg(unix)]
706fn scheduler_record_log_fields(
707 project_path: &Path,
708 record: &crate::automation::run_ledger::AutomationRunLedgerRecord,
709) -> Vec<(&'static str, String)> {
710 use crate::automation::run_ledger::AutomationRunStatus;
711
712 let outcome = match record.status {
713 AutomationRunStatus::Succeeded => "complete",
714 AutomationRunStatus::Failed => "error",
715 AutomationRunStatus::Skipped => "skipped",
716 AutomationRunStatus::Queued => "queued",
717 AutomationRunStatus::Running => "running",
718 };
719 let task = record
720 .task_key
721 .as_deref()
722 .unwrap_or_else(|| crate::automation::backend::task_key(record.task))
723 .to_string();
724 let mut fields = vec![
725 ("project", project_path.display().to_string()),
726 ("task", task),
727 ("outcome", outcome.to_string()),
728 ("run_id", record.run_id.clone()),
729 ];
730 if let Some(reason) = record.fallback_status.as_ref().or(record.error.as_ref()) {
731 fields.push(("reason", reason.clone()));
732 }
733 fields
734}
735
736#[cfg(all(unix, test))]
737fn daemon_scheduler_record_log_line(

Callers 2

Calls 2

task_keyFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected