fix race-condition of same captcha ids
This commit is contained in:
parent
7391cddfb2
commit
6054c974fc
|
@ -109,7 +109,7 @@ export async function checkCaptchaSolution(
|
||||||
if (!captchaid) {
|
if (!captchaid) {
|
||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
const solution = await client.get(`capt:${captchaid}`);
|
const solution = await client.getDel(`capt:${captchaid}`);
|
||||||
if (solution) {
|
if (solution) {
|
||||||
if (evaluateResult(solution, text)) {
|
if (evaluateResult(solution, text)) {
|
||||||
if (Math.random() < 0.1) {
|
if (Math.random() < 0.1) {
|
||||||
|
@ -122,7 +122,7 @@ export async function checkCaptchaSolution(
|
||||||
EX: TTL_CACHE,
|
EX: TTL_CACHE,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
logger.info(`CAPTCHA ${ip} successfully solved captcha`);
|
logger.info(`CAPTCHA ${ip} successfully solved captcha ${text}`);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
logger.info(
|
logger.info(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user