mirror of
https://gitgud.io/fatchan/haproxy-protection.git
synced 2025-05-09 02:05:37 +00:00
reduce concurrency of client check again to max 4 thread
This commit is contained in:
@ -13,7 +13,7 @@ if (window.Worker && crypto.subtle) {
|
|||||||
const challenge = document.querySelector('[data-pow]').dataset.pow;
|
const challenge = document.querySelector('[data-pow]').dataset.pow;
|
||||||
const difficulty = 0;
|
const difficulty = 0;
|
||||||
const start = Date.now();
|
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;
|
let finished = false;
|
||||||
const messageHandler = (e) => {
|
const messageHandler = (e) => {
|
||||||
if (finished) { return; }
|
if (finished) { return; }
|
||||||
|
Reference in New Issue
Block a user