Так.
Параметри таймауту
curlмає два варіанти: --connect-timeoutі --max-time.
Цитування з сторінки сторінки:
--connect-timeout <seconds>
Maximum time in seconds that you allow the connection to the
server to take. This only limits the connection phase, once
curl has connected this option is of no more use. Since 7.32.0,
this option accepts decimal values, but the actual timeout will
decrease in accuracy as the specified timeout increases in deci‐
mal precision. See also the -m, --max-time option.
If this option is used several times, the last one will be used.
і:
-m, --max-time <seconds>
Maximum time in seconds that you allow the whole operation to
take. This is useful for preventing your batch jobs from hang‐
ing for hours due to slow networks or links going down. Since
7.32.0, this option accepts decimal values, but the actual time‐
out will decrease in accuracy as the specified timeout increases
in decimal precision. See also the --connect-timeout option.
If this option is used several times, the last one will be used.
За замовчуванням
Тут (на Debian) він припиняє намагатися підключитися через 2 хвилини, незалежно від часу, вказаного з, --connect-timeoutі хоча значення тайм-ауту підключення за замовчуванням здається 5 хвилин відповідно до DEFAULT_CONNECT_TIMEOUTмакросу lib / connect.h .
Значення за замовчуванням для --max-time, здається, не існує, тому curlзмушуйте вічно чекати відповіді, якщо початкове підключення вдалося.
Що використовувати?
Ви, ймовірно , зацікавлені в останньому варіанті, --max-time. Для вашого випадку встановіть його на 900(15 хвилин).
Вказати варіант --connect-timeoutна щось на кшталт 60(одну хвилину) також може бути хорошою ідеєю. Інакше curlспробуємо підключитися знову і знову, мабуть, використовуючи якийсь алгоритм повернення даних.