restart mining on error

This commit is contained in:
jeka 2024-10-04 23:22:44 +03:00
parent 9a4699ff76
commit 8a672c7faf

View File

@ -29,7 +29,12 @@ const run = async()=>{
const doMine = async(minerInstance)=>{
while (true) {
await minerInstance.mine();
try {
await minerInstance.mine();
} catch (e) {
console.error(e);
console.log('restarting the miner instance...');
}
await new Promise((res)=>setTimeout(res, 100));
};
};