increase the throttle from 100 -> 1 back to 10 to prevent crashing

This commit is contained in:
Thomas Lynch
2023-02-11 21:05:47 +11:00
parent 1612e342ee
commit 9f4c8e8fbb

View File

@ -16,7 +16,7 @@ onmessage = async function(e) {
...argonOpts,
});
// This throttle seems to really help some browsers not stop the workers abruptly
i % 10 === 0 && await new Promise(res => setTimeout(res, 1));
i % 10 === 0 && await new Promise(res => setTimeout(res, 10));
if (hash.hashHex.startsWith(diffString)
&& ((parseInt(hash.hashHex[diffString.length],16) &
0xff >> (((diffString.length+1)*8)-diff)) === 0)) {