Skip to content

Commit

Permalink
fix lasta few nits
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperFluffy committed Oct 1, 2024
1 parent 05a50b3 commit 4d1f5aa
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions crates/astria-conductor/src/conductor/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
mod inner;

use std::future::Future;
use std::{
future::Future,
task::ready,
};

use astria_eyre::eyre::{
self,
Expand Down Expand Up @@ -66,7 +69,9 @@ impl Future for Handle {
.task
.as_mut()
.expect("the Conductor handle must not be polled after shutdown");
task.poll_unpin(cx)?

let res = ready!(task.poll_unpin(cx));
std::task::Poll::Ready(crate::utils::flatten(res))
}
}

Expand Down Expand Up @@ -139,10 +144,10 @@ impl Conductor {
self.restart();
return Ok("restarting");
}
RestartOrShutdown::Shutdown => Ok("conductor exiting"),
RestartOrShutdown::Shutdown => Ok("shutting down"),
},
Ok(Err(err)) => Err(err.wrap_err("conductor exited with an error")),
Err(err) => Err(eyre::ErrReport::from(err).wrap_err("conductor panicked")),
Err(err) => Err(eyre::Report::new(err).wrap_err("conductor panicked")),
}
}

Expand Down

0 comments on commit 4d1f5aa

Please sign in to comment.