Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Translation] Make http requests synchronous when reading the Loco API#44416
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
[Translation] Make http requests synchronous when reading the Loco API#44416
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Kocal commentedDec 2, 2021
Checks failures are unrelated I think. |
Uh oh!
There was an error while loading.Please reload this page.
welcoMattic left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
It is legitimate, as you profiled it and there is no big difference I'm ok to merge it. Thank you@Kocal
nicolas-grekas commentedDec 2, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
BTW, is anyone in touch with Loco, because so far they didn't answer to our ping to back the bridge. (Crowdin and Lokalise did, so you know which bridge you'd better use ;) ) |
Kocal commentedDec 2, 2021
The two foreach have been merged! |
stof commentedDec 2, 2021
I suggest adding a comment in the code mentioning that the Loco API forbids concurrent requests, to explain why this provider does not take advantage of the request concurrency allowed by http-client (so that it does not get refactored in the opposite way by someone not knowing about this API limitation). |
Kern046 commentedDec 2, 2021
They answered us quite quickly about this issue, I contacted them via theircontact form 🤷 |
Kocal commentedDec 3, 2021
A comment has been added, thanks for your reviews. |
fabpot commentedDec 6, 2021
Thank you@Kocal. |
Uh oh!
There was an error while loading.Please reload this page.
Hi!
Since we migrated from thePHP Translation's Loco Adapter to theSymfony's Loco Translation Provider, we started to have 429 errors from the Loco API when running our CI or deploying our code on review apps/staging/production environments:
Some screenshots
We have asked to the Loco support and this is their response:
Which makes sense. AFAIK, the PHP Translation's Loco Adapter makes synchronous requests to get translations from Loco.
Some Blackfire traces, it does not impact performances:
I consider this PR as a bug-fix and not a feature, that's why I've targeted 5.3.
WDYT?
ping@welcoMattic