From 740b33c0bda8b1d7e53c5429d78beb31994c1ce3 Mon Sep 17 00:00:00 2001 From: Brian Henry Date: Wed, 16 Oct 2024 17:52:44 -0700 Subject: [PATCH] Move `$queue->remove` outside loop --- includes/EventManager.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/EventManager.php b/includes/EventManager.php index 7708cb0..9daf245 100644 --- a/includes/EventManager.php +++ b/includes/EventManager.php @@ -272,7 +272,6 @@ public function send_saved_events_batch(): void { $response = $subscriber->notify( $events ); // Due to an unidentified bug causing events to be resent, we are temporarily disabling retries. - $queue->remove( array_keys( $events ) ); continue; if ( ! ( $subscriber instanceof HiiveConnection ) ) { @@ -294,5 +293,8 @@ public function send_saved_events_batch(): void { $queue->release( array_keys( $response['failedEvents'] ) ); } } + + // Due to an unidentified bug causing events to be resent, we are temporarily disabling retries. + $queue->remove( array_keys( $events ) ); } }