Create timer variable to block video polling
This commit is contained in:
@@ -121,7 +121,7 @@ import axios from 'axios';
|
||||
import moment from 'moment';
|
||||
import { useConfirm } from "primevue/useconfirm";
|
||||
import { useToast } from 'primevue/usetoast';
|
||||
import { computed, onMounted, ref } from 'vue';
|
||||
import { computed, onMounted, onUnmounted, ref } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
|
||||
import Button from 'primevue/button';
|
||||
@@ -153,6 +153,7 @@ const userPrefStore = UserPrefStore();
|
||||
const ksVideoStore = KsVideoStore();
|
||||
const loadingStore = LoadingStore();
|
||||
const fe_status = ref('');
|
||||
let updateTimer = null; // Variabile per memorizzare l'ID del timer
|
||||
|
||||
const initFilters = () => {
|
||||
filters.value = {
|
||||
@@ -176,14 +177,18 @@ onMounted(() => {
|
||||
groupName.value = response.data.name;
|
||||
});
|
||||
updateVideos();
|
||||
setInterval(() => {
|
||||
updateTimer = setInterval(() => {
|
||||
updateVideos();
|
||||
}, 5000);
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
if (updateTimer) {
|
||||
clearInterval(updateTimer); // Cancella il timer quando il componente viene distrutto
|
||||
updateTimer = null;
|
||||
}
|
||||
});
|
||||
|
||||
const onRowExpand = (event) => {
|
||||
console.log("Row expanded:", event.data);
|
||||
@@ -298,7 +303,7 @@ const confirmDeleteFromVectorStore = (id) => {
|
||||
}
|
||||
|
||||
const requestPayload = {
|
||||
KsVideoId: id,
|
||||
ksDocumentId: id,
|
||||
ksIngestionInfoId: videoToDelete.ingestionInfo.id,
|
||||
ksDoctype: videoToDelete.ingestionInfo.metadata.KsDoctype,
|
||||
ksDocSource: videoToDelete.ingestionInfo.metadata.KsDocSource,
|
||||
|
||||
Reference in New Issue
Block a user