From 804494dd347f7cdc862ac01e7f8a8301e2a3904c Mon Sep 17 00:00:00 2001 From: Oliver Browne Date: Tue, 6 Aug 2024 18:53:39 +0300 Subject: [PATCH] Update worker.rs --- rust/hook-worker/src/worker.rs | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/rust/hook-worker/src/worker.rs b/rust/hook-worker/src/worker.rs index be685edaf625e..0000b13bd31a1 100644 --- a/rust/hook-worker/src/worker.rs +++ b/rust/hook-worker/src/worker.rs @@ -266,18 +266,14 @@ async fn process_batch<'a>( let results = join_all(futures).await; - if hog_mode { - if (push_hoghook_results_to_kafka( - results, - metadata_vec, - kafka_producer, - cdp_function_callbacks_topic, - ) - .await) - .is_err() - { - return; - } + if hog_mode && push_hoghook_results_to_kafka( + results, + metadata_vec, + kafka_producer, + cdp_function_callbacks_topic, + ).await.is_err() + { + return; } let _ = batch.commit().await.map_err(|e| {