Closed naota7118 closed 1 month ago
タイムアウトとリトライ回数を設定。
@drive = Google::Apis::DriveV3::DriveService.new.tap do |client|
client.request_options.timeout_sec = 1200
client.request_options.open_timeout_sec = 1200
client.request_options.retries = 3
end
Google::Apis::RequestOptions
のインスタンスにtimeout_sec
というメソッドはないと言われる。
@drive = Google::Apis::DriveV3::DriveService.new.tap do |client|
client.client_options.open_timeout_sec = 120
client.client_options.read_timeout_sec = 120
client.request_options.retries = 3
end
タイムアウト秒数を設定するメソッドとリトライ回数を設定するメソッドのクラスが別だった。
タイムアウト秒数はClass: Google::Apis::ClientOptions
https://googleapis.dev/ruby/google-api-client/v0.20.0/Google/Apis/ClientOptions.html
リトライ回数はClass: Google::Apis::RequestOptions
https://googleapis.dev/ruby/google-api-client/v0.28.2/Google/Apis/RequestOptions.html
Google Drive APIでタイムアウトエラーになった。