reduce concurrency of client check again to max 4 thread

master
Thomas Lynch 2 years ago
parent b21cc9e90d
commit bc55ce5a93
Signed by: fatchan
GPG Key ID: 112884AA57DF40B1
  1. 2
      haproxy/js/sha1.js

@ -13,7 +13,7 @@ if (window.Worker && crypto.subtle) {
const challenge = document.querySelector('[data-pow]').dataset.pow;
const difficulty = 0;
const start = Date.now();
const threads = Math.max(1,Math.floor(window.navigator.hardwareConcurrency/2));
const threads = Math.min(4,Math.ceil(window.navigator.hardwareConcurrency/2));
let finished = false;
const messageHandler = (e) => {
if (finished) { return; }

Loading…
Cancel
Save