amplitude-experiment 1.2.0 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f404cf631d8d1063d98e1cb1d84ac87775e6fad2569d1cbdbb4cb09c9d07f788
4
- data.tar.gz: 6f0583a52122d0c07aa5087817524f7dd1b7a1e669231242ba3938ca96891be1
3
+ metadata.gz: e894e7e7ccce306d33d5078ae57fe08fb6a21ecb33e6be30f87c71a7bf119e93
4
+ data.tar.gz: '08a1e613c0eca928c2d4b5ac7c98e7eddc7a35df497c8b0b31881f51b060245b'
5
5
  SHA512:
6
- metadata.gz: f5a42786a515308365e9e1b8796a5caca4bd67c00c059e094ef87bca6891169ffbf456238b257eaa9abf3fd947e4f963e445782e9fabcb552ea55bf13e4f5c13
7
- data.tar.gz: 01af1ba4be8773a21bf31614dd26aef15151eccebaa17c64d326c45d95ff1785623d89422fff43b8c963845a280907d82ddc2071e8ba0ae6c898ea03f27b5897
6
+ metadata.gz: 4fe44dce88027b7d5e1912126a342bab21732e9657d5dadf46c533ea4f156f4d9aed81e97765e05ddcae2cb4ac703355e9b6e856fc2d2cbeb3a01ada5a3121ac
7
+ data.tar.gz: b51fc6e95b72c063bcd7572c7a13220e1ee2a2e164d5d4307d8a194ab77ef2892a24edff30b5dd61277baf124d488b5449c87dd5c5c6eb0b619b5e2be0b14b84
@@ -6,6 +6,8 @@ module AmplitudeExperiment
6
6
  end
7
7
 
8
8
  def should_track(assignment)
9
+ return false if assignment.results.empty?
10
+
9
11
  canonical_assignment = assignment.canonicalize
10
12
  track = @cache.get(canonical_assignment).nil?
11
13
  @cache.put(canonical_assignment, 0) if track
@@ -77,7 +77,7 @@ module AmplitudeExperiment
77
77
  delay_millis = @config.fetch_retry_backoff_min_millis
78
78
  err = nil
79
79
  @config.fetch_retries.times do
80
- sleep(delay_millis / 1000.0)
80
+ sleep(delay_millis.to_f / 1000.0)
81
81
  begin
82
82
  return do_fetch(user, @config.fetch_retry_timeout_millis)
83
83
  rescue StandardError => e
@@ -98,7 +98,7 @@ module AmplitudeExperiment
98
98
  'Authorization' => "Api-Key #{@api_key}",
99
99
  'Content-Type' => 'application/json;charset=utf-8'
100
100
  }
101
- read_timeout = timeout_millis / 1000 if (timeout_millis / 1000) > 0
101
+ read_timeout = timeout_millis.to_f / 1000 if (timeout_millis.to_f / 1000) > 0
102
102
  http = PersistentHttpClient.get(@uri, { read_timeout: read_timeout }, @api_key)
103
103
  request = Net::HTTP::Post.new(@uri, headers)
104
104
  request.body = user_context.to_json
@@ -1,3 +1,3 @@
1
1
  module AmplitudeExperiment
2
- VERSION = '1.2.0'.freeze
2
+ VERSION = '1.2.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amplitude-experiment
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amplitude
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-12 00:00:00.000000000 Z
11
+ date: 2023-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby