Ignore pool logo download failure as it's not a critical error
This commit is contained in:
parent
e3a82dae83
commit
73c55c450c
@ -54,10 +54,14 @@ function downloadMiningPoolLogos() {
|
|||||||
|
|
||||||
response.on('end', () => {
|
response.on('end', () => {
|
||||||
let response_body = Buffer.concat(chunks_of_data);
|
let response_body = Buffer.concat(chunks_of_data);
|
||||||
|
try {
|
||||||
const poolLogos = JSON.parse(response_body.toString());
|
const poolLogos = JSON.parse(response_body.toString());
|
||||||
for (const poolLogo of poolLogos) {
|
for (const poolLogo of poolLogos) {
|
||||||
download(`${PATH}/mining-pools/${poolLogo.name}`, poolLogo.download_url);
|
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}`);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
response.on('error', (error) => {
|
response.on('error', (error) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user