mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2026-01-10 01:14:27 +08:00
added duplicate result log
This commit is contained in:
parent
59e9790874
commit
fd0120d075
1 changed files with 5 additions and 0 deletions
|
|
@ -176,6 +176,11 @@ export async function addResult(
|
|||
if (req.ctx.configuration.users.lastHashesCheck.enabled) {
|
||||
let lastHashes = user.lastReultHashes ?? [];
|
||||
if (lastHashes.includes(resulthash)) {
|
||||
Logger.logToDb("duplicate_result", {
|
||||
lastHashes,
|
||||
resulthash,
|
||||
result,
|
||||
});
|
||||
const status = MonkeyStatusCodes.DUPLICATE_RESULT;
|
||||
throw new MonkeyError(status.code, "Duplicate result");
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue