pub type GcJob = Job<Gc>;Expand description
One maintenance run, queued or completed.
A Job of kind Gc: the queue’s own fields (job_id, state,
queue_position, error, the timestamps, progress) plus a gc’s
GcReport, which dereferences flat — job.bytes_reclaimed reads the
report and job.state the queue, and a caller does not have to know which
half a field is in. The repository is job.key, exactly as the queue keys
on it.
Aliased Type§
pub struct GcJob {
pub job_id: String,
pub key: String,
pub state: JobState,
pub queue_position: u32,
pub progress: Option<(u64, u64)>,
pub error: Option<String>,
pub order: String,
pub report: GcReport,
pub enqueued_at_unix_ms: i64,
pub started_at_unix_ms: i64,
pub finished_at_unix_ms: i64,
}Fields§
§job_id: String§key: StringThe subject, exactly as the queue keys on it — a repository path, an account.
state: JobState§queue_position: u32How many jobs are ahead of this one; 0 unless JobState::Queued.
Computed from the waiting list at read time and never stored, because a stored position is wrong the moment the job in front of it starts, and a queue that reported stale positions would be worse than one that reported none.
progress: Option<(u64, u64)>How far along, as (done, total) — whatever the kind counts in.
None until the job reports one, and for kinds that never do: a gc and
a purge each finish in one indivisible act as far as a caller is
concerned, and a fabricated 0/1 would be a progress bar that lies. A
mirror cannot do without it — a fetch of a large repository is minutes
of network with somebody watching, and a job that sat at Running and
then jumped to Done tells that watcher nothing.
error: Option<String>Only set when JobState::Failed.
order: StringWhat was asked for.
report: GcReportWhat the kind produced. Also reachable field-by-field through Deref.
enqueued_at_unix_ms: i64§started_at_unix_ms: i640 until the job leaves JobState::Queued.
finished_at_unix_ms: i640 until the job leaves JobState::Running.