feat(jobs): exempt polling tools from loop tracker and hint on unchanged checks
This commit is contained in:
@@ -67,8 +67,8 @@ pub struct JobHandle {
|
||||
pub abort_signal: AbortSignal,
|
||||
pub state: Arc<Mutex<JobState>>,
|
||||
pub output_buf: Arc<Mutex<RingBuf>>,
|
||||
#[allow(dead_code)]
|
||||
pub no_change_checks: u32,
|
||||
pub last_check_state: Option<(JobStatus, u64)>,
|
||||
}
|
||||
|
||||
impl JobHandle {
|
||||
@@ -159,6 +159,13 @@ impl Supervisor {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn job_mut(&mut self, id: &str) -> Option<&mut JobHandle> {
|
||||
match self.handles.get_mut(id) {
|
||||
Some(TaskHandle::Job(handle)) => Some(handle),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn jobs(&self) -> impl Iterator<Item = &JobHandle> {
|
||||
self.handles.values().filter_map(|handle| match handle {
|
||||
TaskHandle::Job(handle) => Some(handle),
|
||||
@@ -392,6 +399,7 @@ mod tests {
|
||||
})),
|
||||
output_buf: Arc::new(Mutex::new(RingBuf::default())),
|
||||
no_change_checks: 0,
|
||||
last_check_state: None,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user