Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

always use cache when fetch failed. #100

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/lib/Downloader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export class Downloader extends DownloaderBase {

try {
if(await this.isFileExists(path) && await this.isFileSynced(url, path)) {
console.log(path, url)
return path;
}
}
Expand All @@ -79,7 +80,8 @@ export class Downloader extends DownloaderBase {
return path;
}
else {
throw err;
console.info('DNS lookup timeout, use local caches at this time.');
return path
}

}
Expand Down