Skip to content
12 changes: 10 additions & 2 deletions src/actors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,16 @@ where
futures::pin_mut!(tasks);
futures::select! {
t = tasks => {
if t? == 0 {
smol::Timer::new(std::time::Duration::from_millis(3600)).await;
match t {
Err(coil::FetchError::Timeout) => {
log::warn!("Timeout waiting for task to start");
continue;
},
v => {
if v? == 0 {
smol::Timer::new(std::time::Duration::from_millis(3600)).await;
}
}
Comment on lines +226 to +230
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can do something like

Ok(v) if v == 0 => { … … },
Ok(_) => {} // but maybe we want to log something here?
Err(FailedLoadingJob) => { … … }

Not sure if it's better, but sometimes explicit is good.

}
},
_ = rx.recv_async() => break,
Expand Down