Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose cURL $timeout value #214

Open
DE-dylan-lauzon opened this issue Feb 7, 2025 · 3 comments
Open

Expose cURL $timeout value #214

DE-dylan-lauzon opened this issue Feb 7, 2025 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@DE-dylan-lauzon
Copy link
Contributor

When creating a new source file with a large number of strings and translations, the time to get a response from the Crowdin API is often over 60 seconds, leading to regular cURL errors.

Would it be possible to expose this variable for editing?

I've solved this issue locally by modifying:

line 18 -- CurlHttpClient.php

protected $timeout = 60;

But with every production build, my vendor folder gets reset, so this change is ephemeral.

Image

@andrii-bodnar
Copy link
Member

Hi @DE-dylan-lauzon, thanks for the request!

I think it would be nice to have such a way to configure this timeout, there is also GuzzleHttpClient with the same default timeout value.

@andrii-bodnar andrii-bodnar added enhancement New feature or request good first issue Good for newcomers labels Feb 7, 2025
@andrii-bodnar
Copy link
Member

As a workaround, you could create your own pre-configured HTTP client instance and then pass it to the Crowdin client:

public function setClient(CrowdinHttpClientInterface $client): void

@DE-dylan-lauzon
Copy link
Contributor Author

Great suggestion! Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants