From 847c64f4eda7dcd056e76cee4e8f9d22ba782284 Mon Sep 17 00:00:00 2001 From: Andy Leap <104936100+andrewleap-optimizely@users.noreply.github.com> Date: Tue, 4 Apr 2023 15:33:30 -0400 Subject: [PATCH] fix non_block arg --- lib/optimizely/odp/odp_event_manager.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/optimizely/odp/odp_event_manager.rb b/lib/optimizely/odp/odp_event_manager.rb index 81defab9..fc9084a1 100644 --- a/lib/optimizely/odp/odp_event_manager.rb +++ b/lib/optimizely/odp/odp_event_manager.rb @@ -73,7 +73,7 @@ def start!(odp_config) def flush begin - @event_queue.push(:FLUSH_SIGNAL, non_block: true) + @event_queue.push(:FLUSH_SIGNAL, true) rescue ThreadError @logger.log(Logger::ERROR, 'Error flushing ODP event queue.') return @@ -87,7 +87,7 @@ def flush def update_config begin # Adds update config signal to event_queue. - @event_queue.push(:UPDATE_CONFIG, non_block: true) + @event_queue.push(:UPDATE_CONFIG, true) rescue ThreadError @logger.log(Logger::ERROR, 'Error updating ODP config for the event queue') end @@ -111,7 +111,7 @@ def dispatch(event) begin @logger.log(Logger::DEBUG, 'ODP event queue: adding event.') - @event_queue.push(event, non_block: true) + @event_queue.push(event, true) rescue => e @logger.log(Logger::WARN, format(Helpers::Constants::ODP_LOGS[:ODP_EVENT_FAILED], e.message)) return @@ -143,7 +143,7 @@ def stop! return unless running? begin - @event_queue.push(:SHUTDOWN_SIGNAL, non_block: true) + @event_queue.push(:SHUTDOWN_SIGNAL, true) rescue ThreadError @logger.log(Logger::ERROR, 'Error stopping ODP event queue.') return @@ -175,7 +175,7 @@ def run end begin - item = @event_queue.pop(non_block: true) + item = @event_queue.pop(true) rescue ThreadError => e raise unless e.message == 'queue empty'