diff options
Diffstat (limited to 'lib/bulk_imports/clients/http.rb')
-rw-r--r-- | lib/bulk_imports/clients/http.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/bulk_imports/clients/http.rb b/lib/bulk_imports/clients/http.rb index 6c36875111b..61577ab0c4e 100644 --- a/lib/bulk_imports/clients/http.rb +++ b/lib/bulk_imports/clients/http.rb @@ -9,6 +9,7 @@ module BulkImports DEFAULT_PAGE = 1 DEFAULT_PER_PAGE = 30 PAT_ENDPOINT_MIN_VERSION = '15.5.0' + SIDEKIQ_REQUEST_TIMEOUT = 60 def initialize(url:, token:, page: DEFAULT_PAGE, per_page: DEFAULT_PER_PAGE, api_version: API_VERSION) @url = url @@ -140,7 +141,7 @@ module BulkImports follow_redirects: true, resend_on_redirect: false, limit: 2 - } + }.merge(request_timeout.to_h) end def request_query @@ -151,6 +152,10 @@ module BulkImports } end + def request_timeout + { timeout: SIDEKIQ_REQUEST_TIMEOUT } if Gitlab::Runtime.sidekiq? + end + def with_error_handling response = yield |