Ignore pool logo download failure as it's not a critical error

This commit is contained in:
nymkappa 2023-01-08 11:43:18 +01:00
parent e3a82dae83
commit 73c55c450c
No known key found for this signature in database
GPG Key ID: E155910B16E8BD04

View File

@ -54,9 +54,13 @@ function downloadMiningPoolLogos() {
response.on('end', () => {
let response_body = Buffer.concat(chunks_of_data);
const poolLogos = JSON.parse(response_body.toString());
for (const poolLogo of poolLogos) {
download(`${PATH}/mining-pools/${poolLogo.name}`, poolLogo.download_url);
try {
const poolLogos = JSON.parse(response_body.toString());
for (const poolLogo of poolLogos) {
download(`${PATH}/mining-pools/${poolLogo.name}`, poolLogo.download_url);
}
} catch (e) {
console.error(`Unable to download mining pool logos. Trying again at next restart. Reason: ${e instanceof Error ? e.message : e}`);
}
});