batch-trim session/log tables to reduce churn during high-frequency updates

This commit is contained in:
pa
2025-12-18 14:20:12 +09:00
committed by Natsumi
parent e4b7a36594
commit 49ae88a25e
3 changed files with 15 additions and 5 deletions
+3 -1
View File
@@ -173,7 +173,9 @@ export const useFeedStore = defineStore('Feed', () => {
function addFeed(feed) {
notificationStore.queueFeedNoty(feed);
feedSessionTable.value.push(feed);
feedSessionTable.value.shift();
if (feedSessionTable.value.length > vrcxStore.maxTableSize + 50) {
feedSessionTable.value.splice(0, 50);
}
sharedFeedStore.updateSharedFeed(false);
if (
feedTable.value.filter.length > 0 &&
+2 -2
View File
@@ -482,8 +482,8 @@ export const useGameLogStore = defineStore('GameLog', () => {
function sweepGameLog() {
const { data } = gameLogTable.value;
const j = data.length;
if (j > vrcxStore.maxTableSize) {
data.splice(0, j - vrcxStore.maxTableSize);
if (j > vrcxStore.maxTableSize + 50) {
data.splice(0, 50);
}
const date = new Date();