improve sweeping logic

This commit is contained in:
pa
2025-12-20 04:06:02 +09:00
committed by Natsumi
parent f4e1c745e8
commit d23f33d053
4 changed files with 52 additions and 25 deletions

View File

@@ -103,6 +103,12 @@ const gameLog = {
return 0;
};
gamelogDatabase.sort(compareByCreatedAt);
if (gamelogDatabase.length > dbVars.maxTableSize) {
gamelogDatabase.splice(
0,
gamelogDatabase.length - dbVars.maxTableSize
);
}
return gamelogDatabase;
},