mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-17 13:53:52 +02:00
Fix cache clear at startup
This commit is contained in:
@@ -8,6 +8,7 @@ import { database } from '../../service/database';
|
||||
import { languageCodes } from '../../localization';
|
||||
import { useGameStore } from '../game';
|
||||
import { useModalStore } from '../modal';
|
||||
import { useUpdateLoopStore } from '../updateLoop';
|
||||
import { useVRCXUpdaterStore } from '../vrcxUpdater';
|
||||
import { useVrcxStore } from '../vrcx';
|
||||
import { watchState } from '../../service/watchState';
|
||||
@@ -20,6 +21,7 @@ export const useAdvancedSettingsStore = defineStore('AdvancedSettings', () => {
|
||||
const vrcxStore = useVrcxStore();
|
||||
const VRCXUpdaterStore = useVRCXUpdaterStore();
|
||||
const modalStore = useModalStore();
|
||||
const updateLoopStore = useUpdateLoopStore();
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
@@ -874,6 +876,9 @@ export const useAdvancedSettingsStore = defineStore('AdvancedSettings', () => {
|
||||
vrcxStore.clearVRCXCacheFrequency = Math.trunc(
|
||||
parseInt(value, 10) * 3600 * 2
|
||||
);
|
||||
updateLoopStore.setNextClearVRCXCacheCheck(
|
||||
vrcxStore.clearVRCXCacheFrequency / 2
|
||||
);
|
||||
await configRepository.setString(
|
||||
'VRCX_clearVRCXCacheFrequency',
|
||||
vrcxStore.clearVRCXCacheFrequency.toString()
|
||||
|
||||
@@ -36,7 +36,7 @@ export const useUpdateLoopStore = defineStore('UpdateLoop', () => {
|
||||
nextGroupInstanceRefresh: 0,
|
||||
nextAppUpdateCheck: 3600,
|
||||
ipcTimeout: 0,
|
||||
nextClearVRCXCacheCheck: 0,
|
||||
nextClearVRCXCacheCheck: 86400,
|
||||
nextDiscordUpdate: 0,
|
||||
nextAutoStateChange: 0,
|
||||
nextGetLogCheck: 0,
|
||||
@@ -147,6 +147,10 @@ export const useUpdateLoopStore = defineStore('UpdateLoop', () => {
|
||||
workerTimers.setTimeout(() => updateLoop(), 1000);
|
||||
}
|
||||
|
||||
function setNextClearVRCXCacheCheck(value) {
|
||||
state.nextClearVRCXCacheCheck = value;
|
||||
}
|
||||
|
||||
return {
|
||||
// state,
|
||||
|
||||
@@ -154,6 +158,7 @@ export const useUpdateLoopStore = defineStore('UpdateLoop', () => {
|
||||
nextCurrentUserRefresh,
|
||||
nextDiscordUpdate,
|
||||
ipcTimeout,
|
||||
updateLoop
|
||||
updateLoop,
|
||||
setNextClearVRCXCacheCheck
|
||||
};
|
||||
});
|
||||
|
||||
@@ -211,6 +211,7 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
||||
}
|
||||
|
||||
function clearVRCXCache() {
|
||||
console.log('Clearing VRCX cache...');
|
||||
failedGetRequests.clear();
|
||||
userStore.cachedUsers.forEach((ref, id) => {
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user