ff-ruby-server-sdk 1.4.5 → 1.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a4ab2e35a2f4c9b26b92808b6bd3c8bc1b91dd7be7449fa1ed42324dc7a5dd8c
4
- data.tar.gz: d426cc3eadd246b1db5fa67ec583fb4f5c38591195579b780687ad5582262e5e
3
+ metadata.gz: 619302fd2168c1df9c8a16375f271e31795465530b880cb51986fbc104577c47
4
+ data.tar.gz: b778008b460e9db5f86382e6bd62a6bace2ee543a59fb8d4de9df80bd98ff484
5
5
  SHA512:
6
- metadata.gz: 970504a5a04c27c883b12efc6a54cec3486c14789c3a49389a33dad1d8f43fa0f6fb26046628f397368c4cfa9eb1bd6eca91fb28b72062cd7cec8f0c69ca487a
7
- data.tar.gz: d4fc7208a07a8fec31990f693358b649c5b8e63f23f9b95c605b3321d6d45e9d7a5934b262fcd248c06d3322de450eb3a3686bac63ebc8bf426e18fba2f32cf5
6
+ metadata.gz: fa0fd5bece56084de57aeee050e8dd1ed890981fb868ee50bd44f2219ce3a6b0ac49ffde2c6c8f63131271a57b5f4994d91446f2abfc0bd056ab66a48405c90f
7
+ data.tar.gz: 4c439844d1780986454e7cf685b236715ae71c2535f7481305f81bc839055fc98691c14d214a1252e5975de7ff894fcceea879a0094ecc06e82a6358fb3ce095
@@ -5,13 +5,17 @@ require_relative "inner_client"
5
5
 
6
6
  class CfClient < Closeable
7
7
  include Singleton
8
-
8
+
9
+ @@instance_mutex = Mutex.new
9
10
  def init(api_key, config, connector = nil)
10
11
  # Only initialize if @client is nil to avoid reinitialization
11
- unless @client
12
- @config = config || ConfigBuilder.new.build
13
- @client = InnerClient.new(api_key, @config, connector)
14
- @config.logger.debug "Client initialized with API key: #{api_key}"
12
+
13
+ @@instance_mutex.synchronize do
14
+ unless @client
15
+ @config = config || ConfigBuilder.new.build
16
+ @client = InnerClient.new(api_key, @config, connector)
17
+ @config.logger.debug "Client initialized with API key: #{api_key}"
18
+ end
15
19
  end
16
20
  @client
17
21
  end
@@ -43,6 +47,10 @@ def wait_for_initialization(timeout_ms: nil)
43
47
  @client.json_variation(identifier, target, default_value)
44
48
  end
45
49
 
50
+ def initialized
51
+ @client.initialized
52
+ end
53
+
46
54
  def destroy
47
55
 
48
56
  close
@@ -98,6 +98,10 @@ class InnerClient < ClientCallback
98
98
  @evaluator.json_variation(identifier, target, default_value, @evaluator_callback)
99
99
  end
100
100
 
101
+ def initialized
102
+ @initialized
103
+ end
104
+
101
105
  def on_auth_success
102
106
 
103
107
  SdkCodes::info_sdk_auth_ok @config.logger
@@ -120,9 +124,11 @@ class InnerClient < ClientCallback
120
124
  end
121
125
 
122
126
  def on_auth_failed
123
- SdkCodes::warn_auth_failed_srv_defaults @config.logger
124
- @initialized = true
125
- @condition.signal
127
+ @my_mutex.synchronize do
128
+ SdkCodes::warn_auth_failed_srv_defaults @config.logger
129
+ @initialized = true
130
+ @condition.broadcast
131
+ end
126
132
  end
127
133
 
128
134
  def close
@@ -243,7 +249,7 @@ class InnerClient < ClientCallback
243
249
 
244
250
  SdkCodes.info_sdk_init_ok @config.logger
245
251
 
246
- @condition.signal
252
+ @condition.broadcast
247
253
  @initialized = true
248
254
  end
249
255
  end
@@ -257,7 +263,6 @@ class InnerClient < ClientCallback
257
263
  remaining = timeout ? timeout / 1000.0 : nil # Convert timeout to seconds
258
264
 
259
265
  until @initialized
260
-
261
266
  # Break if timeout has elapsed
262
267
  if remaining && remaining <= 0
263
268
  @config.logger.warn "The SDK has timed out waiting to initialize with supplied timeout #{timeout} ms. The SDK will continue to initialize in the background. Default variations will be served until the SDK initializes."
@@ -5,7 +5,7 @@ module Ff
5
5
  module Server
6
6
  module Sdk
7
7
 
8
- VERSION = "1.4.5"
8
+ VERSION = "1.4.6"
9
9
  end
10
10
  end
11
11
  end
data/scripts/sdk_specs.sh CHANGED
@@ -1,4 +1,4 @@
1
1
  #!/bin/bash
2
2
 
3
3
  export ff_ruby_sdk="ff-ruby-server-sdk"
4
- export ff_ruby_sdk_version="1.4.5"
4
+ export ff_ruby_sdk_version="1.4.6"
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ff-ruby-server-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.5
4
+ version: 1.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - 'Miloš Vasić, cyr.: Милош Васић'
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2024-11-25 00:00:00.000000000 Z
10
+ date: 2025-01-20 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: rake
@@ -288,7 +287,6 @@ metadata:
288
287
  homepage_uri: https://www.harness.io/
289
288
  source_code_uri: https://github.com/harness/ff-ruby-server-sdk
290
289
  changelog_uri: https://github.com/harness/ff-ruby-server-sdk/blob/main/CHANGELOG.md
291
- post_install_message:
292
290
  rdoc_options: []
293
291
  require_paths:
294
292
  - lib
@@ -304,8 +302,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
304
302
  - !ruby/object:Gem::Version
305
303
  version: '0'
306
304
  requirements: []
307
- rubygems_version: 3.5.22
308
- signing_key:
305
+ rubygems_version: 3.6.2
309
306
  specification_version: 4
310
307
  summary: Harness is a feature management platform that helps teams to build better
311
308
  software and to test features quicker.