Skip to content

Commit

Permalink
fix merge resolution error
Browse files Browse the repository at this point in the history
  • Loading branch information
tbro committed Dec 10, 2024
1 parent 89bded5 commit f5c4b87
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions sequencer/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ use hotshot_types::{
PeerConfig, ValidatorConfig,
};
use parking_lot::Mutex;
use std::fmt::Debug;
use std::{fmt::Display, sync::Arc};
use tokio::{spawn, task::JoinHandle};
use tracing::{Instrument, Level};
Expand Down Expand Up @@ -308,7 +309,7 @@ impl<N: ConnectedNetwork<PubKey>, P: SequencerPersistence, V: Versions> Sequence
///
/// When this context is dropped or [`shut_down`](Self::shut_down), background tasks will be
/// cancelled in the reverse order that they were spawned.
pub fn spawn(&mut self, name: impl Display, task: impl Future + Send + 'static) {
pub fn spawn(&mut self, name: impl Display, task: impl Future<Output: Debug> + Send + 'static) {
self.tasks.spawn(name, task);
}

Expand All @@ -319,7 +320,11 @@ impl<N: ConnectedNetwork<PubKey>, P: SequencerPersistence, V: Versions> Sequence
///
/// The only difference between a short-lived background task and a [long-lived](Self::spawn)
/// one is how urgently logging related to the task is treated.
pub fn spawn_short_lived(&mut self, name: impl Display, task: impl Future + Send + 'static) {
pub fn spawn_short_lived(
&mut self,
name: impl Display,
task: impl Future<Output: Debug> + Send + 'static,
) {
self.tasks.spawn_short_lived(name, task);
}

Expand Down Expand Up @@ -439,8 +444,8 @@ macro_rules! spawn_with_log_level {
spawn(
async move {
tracing::event!($lvl, "spawning background task");
$task.await;
tracing::event!($lvl, "background task exited");
let res = $task.await;
tracing::event!($lvl, ?res, "background task exited");
}
.instrument(span),
)
Expand All @@ -454,7 +459,7 @@ impl TaskList {
///
/// When this [`TaskList`] is dropped or [`shut_down`](Self::shut_down), background tasks will
/// be cancelled in the reverse order that they were spawned.
pub fn spawn(&mut self, name: impl Display, task: impl Future + Send + 'static) {
pub fn spawn(&mut self, name: impl Display, task: impl Future<Output: Debug> + Send + 'static) {
spawn_with_log_level!(self, Level::INFO, name, task);
}

Expand All @@ -465,7 +470,11 @@ impl TaskList {
///
/// The only difference between a short-lived background task and a [long-lived](Self::spawn)
/// one is how urgently logging related to the task is treated.
pub fn spawn_short_lived(&mut self, name: impl Display, task: impl Future + Send + 'static) {
pub fn spawn_short_lived(
&mut self,
name: impl Display,
task: impl Future<Output: Debug> + Send + 'static,
) {
spawn_with_log_level!(self, Level::DEBUG, name, task);
}

Expand Down

0 comments on commit f5c4b87

Please sign in to comment.