Skip to content

Commit bfaf1d2

Browse files
author
Bilal Al
committed
polish
1 parent be09c7b commit bfaf1d2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/splitclient-rb/clients/split_client.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,11 @@ def destroy
9999
if !@config.cache_adapter.is_a?(SplitIoClient::Cache::Adapters::RedisAdapter) && @config.impressions_mode != :none &&
100100
(!@impressions_repository.empty? || !@events_repository.empty?)
101101
@config.logger.debug("Impressions and/or Events cache is not empty")
102+
# Adding small delay to ensure sender threads are fully running
103+
sleep(0.1)
102104
if !@config.threads.key?(:impressions_sender) || !@config.threads.key?(:events_sender)
103105
@config.logger.debug("Periodic data recording thread has not started yet, waiting for service startup.")
104-
@config.threads[:start_sdk].join
106+
@config.threads[:start_sdk].join if @config.threads.key?(:start_sdk)
105107
end
106108
end
107109
@config.threads.select { |name, thread| name.to_s.end_with? 'sender' }.values.each do |thread|

spec/splitclient/split_client_spec.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,6 @@
7272

7373
factory5 = SplitIoClient::SplitFactory.new('test_api_key',
7474
features_refresh_rate: 9999,
75-
telemetry_refresh_rate: 99999,
76-
impressions_refresh_rate: 99999,
7775
streaming_enabled: false)
7876
client5 = factory5.client
7977
client5.block_until_ready

0 commit comments

Comments
 (0)