Support block config (#2419)

* fix: refactor block config
This commit is contained in:
Kilu.He
2023-05-04 11:24:35 +08:00
committed by GitHub
parent 1f187a3917
commit cf97c8ba9c
35 changed files with 513 additions and 581 deletions

View File

@ -14,7 +14,10 @@ lazy_static! {
pub fn register_notification_sender<T: NotificationSender>(sender: T) {
let box_sender = Box::new(sender);
match NOTIFICATION_SENDER.write() {
Ok(mut write_guard) => write_guard.push(box_sender),
Ok(mut write_guard) => {
write_guard.pop();
write_guard.push(box_sender)
},
Err(err) => tracing::error!("Failed to push notification sender: {:?}", err),
}
}