diff --git a/frontend/src/components/CurrentlyBuilding.vue b/frontend/src/components/CurrentlyBuilding.vue index 007a08e..bb15da9 100644 --- a/frontend/src/components/CurrentlyBuilding.vue +++ b/frontend/src/components/CurrentlyBuilding.vue @@ -71,6 +71,9 @@ import { onMounted, ref } from 'vue' import type { Packages } from '@/types/Packages' import { Package } from '@/types/Package' +// This variable sets the update-interval +const updateIntervalInMinutes = 5 + const lastUpdatedTime = ref(0) const lastUpdatedSeconds = ref(0) const rtf = new Intl.RelativeTimeFormat('en', { @@ -174,14 +177,17 @@ onMounted(() => { lastUpdatedSeconds.value = Math.floor((Date.now() - lastUpdatedTime.value) / 1000) }, 1000) - const interval = setInterval(() => { - getTotalPackages() - getBuiltPackages() - getBuildingPackages() - getQueuedPackages() - lastUpdatedTime.value = Date.now() - lastUpdatedSeconds.value = Math.floor((Date.now() - lastUpdatedTime.value) / 1000) - }, 120_000) + const interval = setInterval( + () => { + getTotalPackages() + getBuiltPackages() + getBuildingPackages() + getQueuedPackages() + lastUpdatedTime.value = Date.now() + lastUpdatedSeconds.value = Math.floor((Date.now() - lastUpdatedTime.value) / 1000) + }, + updateIntervalInMinutes * 60 * 1000 + ) })