Perf: speed up download previous build

This commit is contained in:
SukkaW 2023-08-18 23:36:52 +08:00
parent 6b324f4079
commit a02038704f
2 changed files with 14 additions and 8 deletions

View File

@ -17,17 +17,24 @@ const fileExists = (path) => {
(async () => {
const filesList = [];
let allFileExists = true;
for await (const line of readFileByLine(resolve(__dirname, '../.gitignore'))) {
if (line.startsWith('List/') && !line.endsWith('/')) {
filesList.push(line);
if (
(
line.startsWith('List/')
|| line.startsWith('Modules/')
) && !line.endsWith('/')
) {
allFileExists = await fileExists(join(__dirname, '..', line));
if (!allFileExists) {
break;
}
}
}
if (
!((await Promise.all(
filesList.map(p => fileExists(join(__dirname, '..', p)))
)).some(exist => !exist))
) {
if (allFileExists) {
console.log('All files exists, skip download.');
return;
}

View File

@ -83,7 +83,6 @@ module.exports.DOMESTICS = /** @type {const} */({
]
},
BYTEDANCE: {
// Currently, bytedance all NS are pointed to AliDNS
dns: '180.184.2.2',
domains: [
'bytecdn.cn',