Notifier errors (#793)

* Handle notifier errors

* Log error for notifier errors
This commit is contained in:
Paul Hauner 2020-01-10 16:01:22 +11:00 committed by GitHub
parent 3afa7b0dab
commit 55a6dc9ae3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,6 +37,7 @@ pub fn spawn_notifier<T: BeaconChainTypes>(
) -> Result<Signal, String> { ) -> Result<Signal, String> {
let log_1 = context.log.clone(); let log_1 = context.log.clone();
let log_2 = context.log.clone(); let log_2 = context.log.clone();
let log_3 = context.log.clone();
let slot_duration = Duration::from_millis(milliseconds_per_slot); let slot_duration = Duration::from_millis(milliseconds_per_slot);
let duration_to_next_slot = beacon_chain let duration_to_next_slot = beacon_chain
@ -161,6 +162,16 @@ pub fn spawn_notifier<T: BeaconChainTypes>(
}; };
Ok(()) Ok(())
})
.then(move |result| {
match result {
Ok(()) => Ok(()),
Err(e) => Ok(error!(
log_3,
"Notifier failed to notify";
"error" => format!("{:?}", e)
))
}
}); });
let (exit_signal, exit) = exit_future::signal(); let (exit_signal, exit) = exit_future::signal();