diff --git a/nuxt/nuxt.config.ts b/nuxt/nuxt.config.ts index d4c7b46..8146671 100644 --- a/nuxt/nuxt.config.ts +++ b/nuxt/nuxt.config.ts @@ -31,8 +31,9 @@ export default defineNuxtConfig({ baseWmataUrl: "https://api.wmata.com", useMockTrainService: false, public: { - refreshInMs: 60000, - incidentRefreshInMs: 120000, + refreshInMs: 60000, // 1min + incidentRefreshInMs: 120000, // 2mins + applicationRefreshInMs: 86400000, // 24hrs }, }, app: { diff --git a/nuxt/pages/index.vue b/nuxt/pages/index.vue index 3be7691..9560fc6 100644 --- a/nuxt/pages/index.vue +++ b/nuxt/pages/index.vue @@ -24,6 +24,8 @@ const { data: station, refresh: refreshStation } = useGetStationById( useMountedInterval(refreshTrains, runtimeConfig.public.refreshInMs); useMountedInterval(refreshIncidents, runtimeConfig.public.incidentRefreshInMs); +// Reload the whole app every 24hrs to prevent expanding memory usage. +useMountedInterval(reloadNuxtApp, runtimeConfig.public.applicationRefreshInMs); const hasIncidents = computed( () =>