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