Skip to content

Commit fefa6cb

Browse files
chore: assert long lasting requests on the ingestion api (generated)
algolia/api-clients-automation#4615 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Clément Vannicatte <[email protected]>
1 parent 6f4a4b4 commit fefa6cb

11 files changed

+123
-75
lines changed

lib/algolia/api/abtesting_client.rb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,6 @@ def self.create(app_id, api_key, region = nil, opts = {})
2323
region = nil
2424
end
2525

26-
if opts.nil? || opts[:connect_timeout].nil?
27-
opts[:connect_timeout] = 2000
28-
end
29-
30-
if opts.nil? || opts[:read_timeout].nil?
31-
opts[:read_timeout] = 5000
32-
end
33-
34-
if opts.nil? || opts[:write_timeout].nil?
35-
opts[:write_timeout] = 30000
36-
end
37-
3826
if !region.nil? && (!region.is_a?(String) || !regions.include?(region))
3927
raise "`region` must be one of the following: #{regions.join(", ")}"
4028
end
@@ -50,6 +38,18 @@ def self.create(app_id, api_key, region = nil, opts = {})
5038
end
5139

5240
def self.create_with_config(config)
41+
if config.connect_timeout.nil? || config.connect_timeout.empty?
42+
config.connect_timeout = 2000
43+
end
44+
45+
if config.read_timeout.nil? || config.read_timeout.empty?
46+
config.read_timeout = 5000
47+
end
48+
49+
if config.write_timeout.nil? || config.write_timeout.empty?
50+
config.write_timeout = 30000
51+
end
52+
5353
new(config)
5454
end
5555

lib/algolia/api/analytics_client.rb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,6 @@ def self.create(app_id, api_key, region = nil, opts = {})
2323
region = nil
2424
end
2525

26-
if opts.nil? || opts[:connect_timeout].nil?
27-
opts[:connect_timeout] = 2000
28-
end
29-
30-
if opts.nil? || opts[:read_timeout].nil?
31-
opts[:read_timeout] = 5000
32-
end
33-
34-
if opts.nil? || opts[:write_timeout].nil?
35-
opts[:write_timeout] = 30000
36-
end
37-
3826
if !region.nil? && (!region.is_a?(String) || !regions.include?(region))
3927
raise "`region` must be one of the following: #{regions.join(", ")}"
4028
end
@@ -50,6 +38,18 @@ def self.create(app_id, api_key, region = nil, opts = {})
5038
end
5139

5240
def self.create_with_config(config)
41+
if config.connect_timeout.nil? || config.connect_timeout.empty?
42+
config.connect_timeout = 2000
43+
end
44+
45+
if config.read_timeout.nil? || config.read_timeout.empty?
46+
config.read_timeout = 5000
47+
end
48+
49+
if config.write_timeout.nil? || config.write_timeout.empty?
50+
config.write_timeout = 30000
51+
end
52+
5353
new(config)
5454
end
5555

lib/algolia/api/composition_client.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,18 @@ def self.create(app_id, api_key, opts = {})
3131
end
3232

3333
def self.create_with_config(config)
34+
if config.connect_timeout.nil? || config.connect_timeout.empty?
35+
config.connect_timeout = 2000
36+
end
37+
38+
if config.read_timeout.nil? || config.read_timeout.empty?
39+
config.read_timeout = 5000
40+
end
41+
42+
if config.write_timeout.nil? || config.write_timeout.empty?
43+
config.write_timeout = 30000
44+
end
45+
3446
new(config)
3547
end
3648

lib/algolia/api/ingestion_client.rb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,6 @@ def self.create(app_id, api_key, region = nil, opts = {})
2323
region = nil
2424
end
2525

26-
if opts.nil? || opts[:connect_timeout].nil?
27-
opts[:connect_timeout] = 25000
28-
end
29-
30-
if opts.nil? || opts[:read_timeout].nil?
31-
opts[:read_timeout] = 25000
32-
end
33-
34-
if opts.nil? || opts[:write_timeout].nil?
35-
opts[:write_timeout] = 25000
36-
end
37-
3826
if region.nil? || !region.is_a?(String) || !regions.include?(region)
3927
raise "`region` is required and must be one of the following: #{regions.join(", ")}"
4028
end
@@ -50,6 +38,18 @@ def self.create(app_id, api_key, region = nil, opts = {})
5038
end
5139

5240
def self.create_with_config(config)
41+
if config.connect_timeout.nil? || config.connect_timeout.empty?
42+
config.connect_timeout = 25000
43+
end
44+
45+
if config.read_timeout.nil? || config.read_timeout.empty?
46+
config.read_timeout = 25000
47+
end
48+
49+
if config.write_timeout.nil? || config.write_timeout.empty?
50+
config.write_timeout = 25000
51+
end
52+
5353
new(config)
5454
end
5555

lib/algolia/api/insights_client.rb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,6 @@ def self.create(app_id, api_key, region = nil, opts = {})
2323
region = nil
2424
end
2525

26-
if opts.nil? || opts[:connect_timeout].nil?
27-
opts[:connect_timeout] = 2000
28-
end
29-
30-
if opts.nil? || opts[:read_timeout].nil?
31-
opts[:read_timeout] = 5000
32-
end
33-
34-
if opts.nil? || opts[:write_timeout].nil?
35-
opts[:write_timeout] = 30000
36-
end
37-
3826
if !region.nil? && (!region.is_a?(String) || !regions.include?(region))
3927
raise "`region` must be one of the following: #{regions.join(", ")}"
4028
end
@@ -50,6 +38,18 @@ def self.create(app_id, api_key, region = nil, opts = {})
5038
end
5139

5240
def self.create_with_config(config)
41+
if config.connect_timeout.nil? || config.connect_timeout.empty?
42+
config.connect_timeout = 2000
43+
end
44+
45+
if config.read_timeout.nil? || config.read_timeout.empty?
46+
config.read_timeout = 5000
47+
end
48+
49+
if config.write_timeout.nil? || config.write_timeout.empty?
50+
config.write_timeout = 30000
51+
end
52+
5353
new(config)
5454
end
5555

lib/algolia/api/monitoring_client.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,18 @@ def self.create(app_id, api_key, opts = {})
2323
end
2424

2525
def self.create_with_config(config)
26+
if config.connect_timeout.nil? || config.connect_timeout.empty?
27+
config.connect_timeout = 2000
28+
end
29+
30+
if config.read_timeout.nil? || config.read_timeout.empty?
31+
config.read_timeout = 5000
32+
end
33+
34+
if config.write_timeout.nil? || config.write_timeout.empty?
35+
config.write_timeout = 30000
36+
end
37+
2638
new(config)
2739
end
2840

lib/algolia/api/personalization_client.rb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,6 @@ def self.create(app_id, api_key, region = nil, opts = {})
2323
region = nil
2424
end
2525

26-
if opts.nil? || opts[:connect_timeout].nil?
27-
opts[:connect_timeout] = 2000
28-
end
29-
30-
if opts.nil? || opts[:read_timeout].nil?
31-
opts[:read_timeout] = 5000
32-
end
33-
34-
if opts.nil? || opts[:write_timeout].nil?
35-
opts[:write_timeout] = 30000
36-
end
37-
3826
if region.nil? || !region.is_a?(String) || !regions.include?(region)
3927
raise "`region` is required and must be one of the following: #{regions.join(", ")}"
4028
end
@@ -50,6 +38,18 @@ def self.create(app_id, api_key, region = nil, opts = {})
5038
end
5139

5240
def self.create_with_config(config)
41+
if config.connect_timeout.nil? || config.connect_timeout.empty?
42+
config.connect_timeout = 2000
43+
end
44+
45+
if config.read_timeout.nil? || config.read_timeout.empty?
46+
config.read_timeout = 5000
47+
end
48+
49+
if config.write_timeout.nil? || config.write_timeout.empty?
50+
config.write_timeout = 30000
51+
end
52+
5353
new(config)
5454
end
5555

lib/algolia/api/query_suggestions_client.rb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,6 @@ def self.create(app_id, api_key, region = nil, opts = {})
2323
region = nil
2424
end
2525

26-
if opts.nil? || opts[:connect_timeout].nil?
27-
opts[:connect_timeout] = 2000
28-
end
29-
30-
if opts.nil? || opts[:read_timeout].nil?
31-
opts[:read_timeout] = 5000
32-
end
33-
34-
if opts.nil? || opts[:write_timeout].nil?
35-
opts[:write_timeout] = 30000
36-
end
37-
3826
if region.nil? || !region.is_a?(String) || !regions.include?(region)
3927
raise "`region` is required and must be one of the following: #{regions.join(", ")}"
4028
end
@@ -50,6 +38,18 @@ def self.create(app_id, api_key, region = nil, opts = {})
5038
end
5139

5240
def self.create_with_config(config)
41+
if config.connect_timeout.nil? || config.connect_timeout.empty?
42+
config.connect_timeout = 2000
43+
end
44+
45+
if config.read_timeout.nil? || config.read_timeout.empty?
46+
config.read_timeout = 5000
47+
end
48+
49+
if config.write_timeout.nil? || config.write_timeout.empty?
50+
config.write_timeout = 30000
51+
end
52+
5353
new(config)
5454
end
5555

lib/algolia/api/recommend_client.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,18 @@ def self.create(app_id, api_key, opts = {})
3131
end
3232

3333
def self.create_with_config(config)
34+
if config.connect_timeout.nil? || config.connect_timeout.empty?
35+
config.connect_timeout = 2000
36+
end
37+
38+
if config.read_timeout.nil? || config.read_timeout.empty?
39+
config.read_timeout = 5000
40+
end
41+
42+
if config.write_timeout.nil? || config.write_timeout.empty?
43+
config.write_timeout = 30000
44+
end
45+
3446
new(config)
3547
end
3648

lib/algolia/api/search_client.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,18 @@ def self.create(app_id, api_key, opts = {})
3434
end
3535

3636
def self.create_with_config(config)
37+
if config.connect_timeout.nil? || config.connect_timeout.empty?
38+
config.connect_timeout = 2000
39+
end
40+
41+
if config.read_timeout.nil? || config.read_timeout.empty?
42+
config.read_timeout = 5000
43+
end
44+
45+
if config.write_timeout.nil? || config.write_timeout.empty?
46+
config.write_timeout = 30000
47+
end
48+
3749
new(config)
3850
end
3951

0 commit comments

Comments
 (0)