Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

Feature/http timeouts #44

Merged
merged 2 commits into from
Nov 30, 2020

Conversation

kamilbednarz
Copy link
Collaborator

Allow customizing HTTP timeout for the API calls.

The API gets slow sometimes, I don't want to wait 60 seconds for my workers to fail.

@@ -17,9 +17,11 @@ class ApiClient
COGNITIVE_ACCESS_TOKEN_URI =
URI.parse('https://api.cognitive.microsoft.com/sts/v1.0/issueToken').freeze

def initialize(subscription_key, skip_ssl_verify)
def initialize(subscription_key, skip_ssl_verify, read_timeout = 60, open_timeout = 60)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ruby's defaults

@kamilbednarz kamilbednarz merged commit 6de2c78 into relrod:master Nov 30, 2020
@kamilbednarz kamilbednarz deleted the feature/http-timeouts branch November 30, 2020 17:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant