Skip to content

feat: configurable download timeout (default 30 min) - #24

Merged
alkoleft merged 1 commit into
mainfrom
fix/download-timeout
Oct 28, 2026
Merged

alkoleft merged 1 commit into
mainfrom
fix/download-timeout

Conversation

@alkoleft

Copy link
Copy Markdown
Member

Описание

Скачивание дистрибутивов падало на медленных зеркалах 1С:

Download https://dl02.1c.ru/public/file/get/... to .../tmp/__downloads__
Error: Request failed: Timeout awaiting 'request' for 300000ms

Причина

В HttpClient для стримингового скачивания был жёстко задан timeout: { request: 300000 } («5 minutes for large files»). Но в got v11 timeout.request — лимит на всю длительность запроса, включая тело. Для офлайн-дистрибутива EDT (~1.5 ГБ) это требует устойчивой скорости ≥ 5 МБ/с от dl02.1c.ru на всём протяжении загрузки; при проседании скорости got обрывает запрос. Ретраев для стримов в got нет — шаг падает сразу.

Изменения

  • Новый вход download_timeout (секунды, по умолчанию 1800 вместо 300): прокидывается installer.run() → EDT/Platform83 → downloadRelease → OneGet → Client → HttpClient.
  • Обратная совместимость: конфиг Client (третий аргумент) расширен полем downloadTimeout, позиционных изменений сигнатуры нет — существующие вызовы ({ preferredProvider }) компилируются без правок.
  • Дефолт повышен и для случая «вход не задан» (fallback 1800 внутри HttpClient).

Проверено

  • pnpm run format:check — ok, pnpm run lint — 0 ошибок (12 warnings — ранее существующие)
  • pnpm run ci-test — те же 8 pre-existing падений, что и на чистом main (креды/сеть), новых нет
  • pnpm run package — dist пересобран

Таймаут скачивания дистрибутивов был жёстко задан 300000мс (5 минут)
на весь запрос. В got v11 timeout.request ограничивает суммарную
длительность запроса, включая тело: для офлайн-дистрибутивов EDT
(~1.5ГБ) это требует устойчивых 5+ МБ/с от зеркал 1С, иначе загрузка
обрывается: 'Request failed: Timeout awaiting request for 300000ms'.

Новый вход download_timeout (секунды, по умолчанию 1800) прокидывается
в стриминговый запрос got.
@coderabbitai

coderabbitai Bot commented Oct 28, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 6 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 57f3cb6a-8ec6-41c2-9a01-4316de0c38a8
Commits

Reviewing files that changed from the base of the PR and between f1a202e and 1f824b2.

Files ignored due to path filters: 2
  • dist/index.js is excluded by !**/dist/**
  • dist/index.js.map is excluded by !**/dist/**, !**/*.map
Files selected for processing: 7
  • action.yml
  • src/installer.ts
  • src/onegetjs/downloader.ts
  • src/onegetjs/httpClient.ts
  • src/onegetjs/index.ts
  • src/tools/edt.ts
  • src/tools/platform83.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@alkoleft

Copy link
Copy Markdown
Member Author

Красный TypeScript Tests — pre-existing (те же 8 падений на чистом main: нужны реальные креды releases.1c.ru). Новых падений нет — количество тестов и состав упавших идентичны main.

@alkoleft
alkoleft merged commit 68432cf into main Oct 28, 2026
6 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant