Skip to content

Commit

Permalink
increase timeout for presigned obj
Browse files Browse the repository at this point in the history
  • Loading branch information
terrywbrady committed Jan 6, 2024
1 parent ce39dc7 commit d6ec4a0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ def presign_obj_by_token
def do_presign_obj_by_token(token, filename = 'object.zip', no_redirect = nil)
r = create_http_cli(connect: 5, receive: 5, send: 5).get(
File.join(APP_CONFIG['storage_presign_token'], token),
{ timeout: 24 * 60 },
{ contentDisposition: "attachment; filename=#{filename}" },
{},
follow_redirect: true
)
eval_presign_obj_by_token(r, no_redirect)
Expand Down
12 changes: 6 additions & 6 deletions spec/controllers/application_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,8 @@ def mock_httpclient
filename = 'object.zip'
expect(@client).to receive(:get).with(
File.join(APP_CONFIG['storage_presign_token'], token),
{ timeout: 24 * 60 },
{ contentDisposition: "attachment; filename=#{filename}" },
{},
follow_redirect: true
).and_return(
mock_response(
Expand All @@ -330,8 +330,8 @@ def mock_httpclient
filename = 'object.zip'
expect(@client).to receive(:get).with(
File.join(APP_CONFIG['storage_presign_token'], token),
{ timeout: 24 * 60 },
{ contentDisposition: "attachment; filename=#{filename}" },
{},
follow_redirect: true
).and_return(
mock_response(
Expand All @@ -356,8 +356,8 @@ def mock_httpclient
filename = 'object.zip'
expect(@client).to receive(:get).with(
File.join(APP_CONFIG['storage_presign_token'], token),
{ timeout: 24 * 60 },
{ contentDisposition: "attachment; filename=#{filename}" },
{},
follow_redirect: true
).and_return(
mock_response(
Expand All @@ -380,8 +380,8 @@ def mock_httpclient
filename = 'object.zip'
expect(@client).to receive(:get).with(
File.join(APP_CONFIG['storage_presign_token'], token),
{ timeout: 24 * 60 },
{ contentDisposition: "attachment; filename=#{filename}" },
{},
follow_redirect: true
).and_return(
mock_response(
Expand All @@ -399,8 +399,8 @@ def mock_httpclient
filename = 'object.zip'
expect(@client).to receive(:get).with(
File.join(APP_CONFIG['storage_presign_token'], token),
{ timeout: 24 * 60 },
{ contentDisposition: "attachment; filename=#{filename}" },
{},
follow_redirect: true
).and_return(
mock_response(
Expand All @@ -417,8 +417,8 @@ def mock_httpclient
filename = 'object.zip'
expect(@client).to receive(:get).with(
File.join(APP_CONFIG['storage_presign_token'], token),
{ timeout: 24 * 60 },
{ contentDisposition: "attachment; filename=#{filename}" },
{},
follow_redirect: true
).and_raise(
HTTPClient::ReceiveTimeoutError
Expand Down

0 comments on commit d6ec4a0

Please sign in to comment.