mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-17 22:29:52 +08:00
added buffer second
This commit is contained in:
parent
052e120bd8
commit
e4632d3f91
1 changed files with 2 additions and 2 deletions
|
|
@ -142,10 +142,10 @@ class ResultController {
|
|||
|
||||
result.timestamp = Math.floor(Date.now() / 1000) * 1000;
|
||||
|
||||
//check if now is earlier than last result plus duration
|
||||
//check if now is earlier than last result plus duration (-1 second as a buffer)
|
||||
const earliestPossible = lastResultTimestamp + testDurationMilis;
|
||||
const nowNoMilis = Math.floor(Date.now() / 1000) * 1000;
|
||||
if (lastResultTimestamp && nowNoMilis < earliestPossible) {
|
||||
if (lastResultTimestamp && nowNoMilis < earliestPossible - 1000) {
|
||||
Logger.log(
|
||||
"invalid_result_spacing",
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue