ft_gem 3.0.1 → 3.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ft_gem/controllers/helpers.rb +1 -1
- data/lib/ft_gem/shared/ft_shared.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4db912daaeeb0db5f4c4f53619d7069f67d9e8fbbed1af743626ec1c33f4f580
|
4
|
+
data.tar.gz: 90063c269dd4d8282f4c1e415d17a565a6270a318dd59db5f77edf317b4e2368
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6a7bab0398bccc298e3e559bdad08626b43fde41d32d2dae6cd4b2391556193917af0c0ee4fcfa15f047fe7b0ec12ec46f48e7db9cb67aa6bc3ca8e9ac34ddb
|
7
|
+
data.tar.gz: 90e54c1ba7272e485d5adb3bd6a79017cbfc1331ce4d3b80f095c694206c1a771267251e81fe5be2836bd2812c471166ceec2797f61472d15f750da8354f471a
|
@@ -27,7 +27,7 @@ module FtGem
|
|
27
27
|
client_percentage = calc_client_percentage(decoded_cookie: decoded_cookie, toggle_name: toggle['attributes']['name'])
|
28
28
|
new_cookie.push("#{toggle['attributes']['name']}:#{client_percentage}")
|
29
29
|
end
|
30
|
-
cookies[TOGGLE_COOKIE_NAME] = { value: Base64.encode64(new_cookie.join(',')).to_s }
|
30
|
+
cookies[TOGGLE_COOKIE_NAME] = { value: Base64.encode64(new_cookie.join(',')).to_s, domain: ENV['COOKIE_DOMAIN'] }
|
31
31
|
rescue StandardError => e
|
32
32
|
Rails.logger.error "FTApiGem::update_feature_toggles error #{e.backtrace}"
|
33
33
|
nil
|
@@ -2,7 +2,7 @@ module FtShared
|
|
2
2
|
class <<self
|
3
3
|
def fetch(name:)
|
4
4
|
Rails.cache.fetch("feature-toggle-#{name}", expires_in: 1.minute) do
|
5
|
-
JSON.parse(HTTP.headers(authentication_header).get("#{ENV['SITE_URL']}/service/ft/api/v1/feature-toggles/status", params: { name: name }).body.to_s)['data']
|
5
|
+
JSON.parse(HTTP.timeout(1).headers(authentication_header).get("#{ENV['SITE_URL']}/service/ft/api/v1/feature-toggles/status", params: { name: name }).body.to_s)['data']
|
6
6
|
end
|
7
7
|
rescue StandardError => e
|
8
8
|
Rails.logger.error "FtHelper::fetch error #{e.backtrace}"
|
@@ -11,7 +11,7 @@ module FtShared
|
|
11
11
|
|
12
12
|
def all_toggles
|
13
13
|
Rails.cache.fetch('all-feature-toggles', expires_in: 1.minute) do
|
14
|
-
JSON.parse(HTTP.headers(authentication_header).get("#{ENV['SITE_URL']}/service/ft/api/v1/feature-toggles/"))['data']
|
14
|
+
JSON.parse(HTTP.timeout(1).headers(authentication_header).get("#{ENV['SITE_URL']}/service/ft/api/v1/feature-toggles/"))['data']
|
15
15
|
end
|
16
16
|
rescue StandardError => e
|
17
17
|
Rails.logger.error "FtHelper::all_toggles error #{e.backtrace}"
|