Skip to content

Commit b4bf159

Browse files
authored
fix: RemoteEvaluationClient variant fetch timeout (#51)
1 parent 01d5bf9 commit b4bf159

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/experiment/remote/client.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def retry_fetch(user)
7777
delay_millis = @config.fetch_retry_backoff_min_millis
7878
err = nil
7979
@config.fetch_retries.times do
80-
sleep(delay_millis / 1000.0)
80+
sleep(delay_millis.to_f / 1000.0)
8181
begin
8282
return do_fetch(user, @config.fetch_retry_timeout_millis)
8383
rescue StandardError => e
@@ -98,7 +98,7 @@ def do_fetch(user, timeout_millis)
9898
'Authorization' => "Api-Key #{@api_key}",
9999
'Content-Type' => 'application/json;charset=utf-8'
100100
}
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
102102
http = PersistentHttpClient.get(@uri, { read_timeout: read_timeout }, @api_key)
103103
request = Net::HTTP::Post.new(@uri, headers)
104104
request.body = user_context.to_json

0 commit comments

Comments
 (0)