improve code for event

This commit is contained in:
houseme
2025-05-25 17:52:22 +08:00
parent 0f22b21c8d
commit dee19fdc35
20 changed files with 1258 additions and 66 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ impl NotifierSystem {
/// Creates a new `NotificationSystem` instance.
#[instrument(skip(config))]
pub async fn new(config: NotifierConfig) -> Result<Self, Error> {
let (tx, rx) = mpsc::channel::<Event>(config.channel_capacity);
let (tx, rx) = mpsc::channel::<Event>(config.channel_capacity.try_into().unwrap());
let store = Arc::new(EventStore::new(&config.store_path).await?);
let shutdown = CancellationToken::new();