mirror of
https://github.com/suidouble/sui_meta_miner.git
synced 2026-02-21 15:17:22 +08:00
restart mining on error
This commit is contained in:
parent
9a4699ff76
commit
8a672c7faf
7
mine.js
7
mine.js
@ -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));
|
||||
};
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user