Update MediaService.php

This commit is contained in:
Lizandro Guarnizo
2026-02-21 11:03:03 -05:00
parent 36a1b556c3
commit 26afa7f36b
+4 -2
View File
@@ -258,8 +258,10 @@ class MediaService {
$headerArgs .= ' --header=' . escapeshellarg($h);
}
}
// --tries=5: reintenta automáticamente ante Connection reset by peer (problema con lookaside.fbsbx.com)
$cmd = 'wget --tries=5 --prefer-family=IPv4 -O ' . escapeshellarg($tmpFile) . $headerArgs . ' ' . escapeshellarg($url) . ' 2>&1';
// --continue: reanuda desde donde se cortó (evita reiniciar ante Connection reset by peer)
// --tries=10 --waitretry=3: reintenta hasta 10 veces esperando 3s entre intentos
// --prefer-family=IPv4: evitar problemas IPv6
$cmd = 'wget --continue --tries=10 --waitretry=3 --prefer-family=IPv4 -O ' . escapeshellarg($tmpFile) . $headerArgs . ' ' . escapeshellarg($url) . ' 2>&1';
try {
exec($cmd, $output, $exitCode);
} catch (\Error $e) {