Move retries option to client execute methods

Refs GOOF-658

Test Plan: Test that an assignment upload works from
google doc plugin(not lti)

Change-Id: Id9a75d964c60c42336ef827e2472720f33d855a5
Reviewed-on: https://gerrit.instructure.com/173424
Reviewed-by: Nick Houle <nhoule@instructure.com>
Reviewed-by: Jeremy Slade <jslade@instructure.com>
Product-Review: Nick Houle <nhoule@instructure.com>
Tested-by: Jenkins
QA-Review: Pedro Fajardo <pfajardo@instructure.com>
This commit is contained in:
Josh Orr 2018-11-27 13:44:08 -06:00 committed by Joshua Orr
parent 93a6d18046
commit 8b39ee0e00
1 changed files with 4 additions and 4 deletions

View File

@ -41,10 +41,12 @@ module GoogleDrive
end
def client_execute(options)
options[:retries] = 9
with_timeout_protection { api_client.execute(options) }
end
def client_execute!(options)
options[:retries] = 9
with_timeout_protection { api_client.execute!(options) }
end
@ -55,8 +57,7 @@ module GoogleDrive
def download(document_id, extensions)
response = client_execute!(
:api_method => drive.files.get,
:parameters => { :fileId => normalize_document_id(document_id) },
:retries => 9
:parameters => { :fileId => normalize_document_id(document_id) }
)
file = response.data.to_hash
@ -148,8 +149,7 @@ module GoogleDrive
result = client_execute(
:api_method => drive.permissions.insert,
:body_object => new_permission,
:parameters => { :fileId => normalize_document_id(document_id),
:retries => 9 }
:parameters => { :fileId => normalize_document_id(document_id)}
)
if result.error?
raise ConnectionException, result.error_message