Fix LibreTranslate timeout: increase wait to 3min, add Ansible healthcheck wait

- TranslateCommand: increase waitForApi retries from 30 to 90 (3 minutes total)
- Ansible deploy: add explicit healthcheck wait step (60×5s = 5min max) before translation
- First launch downloads ~2-4GB of language models, needs more time

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Serreau Jovann
2026-03-23 18:10:54 +01:00
parent da0076fa51
commit acccd4a0c4
2 changed files with 11 additions and 1 deletions

View File

@@ -135,6 +135,16 @@
args:
chdir: /var/www/e-ticket
- name: Wait for LibreTranslate to be healthy
shell: |
for i in $(seq 1 60); do
docker compose -f docker-compose-prod.yml exec -T libretranslate curl -sf http://localhost:5000/languages >/dev/null 2>&1 && exit 0
sleep 5
done
exit 1
args:
chdir: /var/www/e-ticket
- name: Translate YAML files (FR → EN/ES/DE/IT) and stop LibreTranslate
command: make trans_prod
args:

View File

@@ -270,7 +270,7 @@ class TranslateCommand extends Command
{
$io->text('Waiting for LibreTranslate at '.$apiUrl.'...');
for ($i = 0; $i < 30; ++$i) {
for ($i = 0; $i < 90; ++$i) {
try {
$response = $this->httpClient->request('GET', $apiUrl.'/languages', ['timeout' => 5]);
if (200 === $response->getStatusCode()) {