From d5bf9ceb1bf5b4c67c43a77dfce300acc4674180 Mon Sep 17 00:00:00 2001 From: fengmk2 Date: Sat, 6 Jan 2024 21:08:41 +0800 Subject: [PATCH] fix: github file size limit increased to 250mb (#632) closes https://github.com/cnpm/cnpm/issues/435 --- app/common/adapter/binary/GithubBinary.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/common/adapter/binary/GithubBinary.ts b/app/common/adapter/binary/GithubBinary.ts index 36f08378..bfae2f84 100644 --- a/app/common/adapter/binary/GithubBinary.ts +++ b/app/common/adapter/binary/GithubBinary.ts @@ -40,10 +40,13 @@ export class GithubBinary extends AbstractBinary { protected formatItems(releaseItem: any, binaryConfig: BinaryTaskConfig) { const items: BinaryItem[] = []; - // 200MB - const maxFileSize = 1024 * 1024 * 200; + // 250MB + const maxFileSize = 1024 * 1024 * 250; for (const asset of releaseItem.assets) { - if (asset.size > maxFileSize) continue; + if (asset.size > maxFileSize) { + this.logger.info('[GithubBinary.formatItems] asset reach max file size(> 250MB), ignore download it, asset: %j', asset); + continue; + } items.push({ name: asset.name, isDir: false,