Skip to content

Commit

Permalink
Optional pure event handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
Jurshsmith committed Apr 20, 2024
1 parent 785c46b commit 087cdd6
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions chaindexing/src/handlers/handle_events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,16 @@ pub async fn run<'a, S: Send + Sync + Clone + Debug>(

for event in &events {
{
let handler = pure_handlers.get(event.get_abi()).unwrap();
let handler_context = PureHandlerContext::new(
event,
&txn_client,
repo_client_for_mcs,
deferred_mutations_for_mcs,
);

handler.handle_event(handler_context).await;
if let Some(handler) = pure_handlers.get(event.get_abi()) {
let handler_context = PureHandlerContext::new(
event,
&txn_client,
repo_client_for_mcs,
deferred_mutations_for_mcs,
);

handler.handle_event(handler_context).await;
}
}

{
Expand Down

0 comments on commit 087cdd6

Please sign in to comment.