From bc55ce5a9331b6b24ebf656fe273702b802bc0f7 Mon Sep 17 00:00:00 2001 From: Thomas Lynch Date: Wed, 1 Dec 2021 13:54:21 +1100 Subject: [PATCH] reduce concurrency of client check again to max 4 thread --- haproxy/js/sha1.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haproxy/js/sha1.js b/haproxy/js/sha1.js index 3773b8e..552123c 100644 --- a/haproxy/js/sha1.js +++ b/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; }