@@ -39,8 +39,6 @@ export default {
3939 retryCount: 0 ,
4040 maxRetries: 3 ,
4141 retryDelay: 5000 ,
42- localCheckInterval: 1000 , // Default value or a fallback
43- pollInterval: null ,
4442 }),
4543 computed: {
4644 percentage : function () {
@@ -57,40 +55,23 @@ export default {
5755 },
5856 created () {
5957 if (parseInt (this .item .apiVersion , 10 ) === 6 ) {
60- // Set the interval to the checkInterval or default to 5 minutes
61- this .localCheckInterval = parseInt (this .item .checkInterval , 10 ) || 300000 ;
6258 this .loadCachedSession ();
63- this .startStatusPolling ();
59+
60+ // Set up auto-update method for the scheduler
61+ this .autoUpdateMethod = this .fetchStatus ;
6462 } else {
65- this .fetchStatus_v5 ();
66- }
67- },
68- beforeUnmount () {
69- if (parseInt (this .item .apiVersion , 10 ) === 6 ) {
70- this .stopStatusPolling ();
63+ // Set up auto-update method for the scheduler
64+ this .autoUpdateMethod = this .fetchStatus_v5 ();
7165 }
66+ // Initial data fetch
67+ this .autoUpdateMethod ();
7268 },
7369 methods: {
7470 handleError : function (error , status ) {
7571 console .error (error);
7672 this .subtitle = error;
7773 this .status = status;
7874 },
79- startStatusPolling : function () {
80- this .fetchStatus ();
81- if (this .localCheckInterval < 1000 ) {
82- this .localCheckInterval = 1000 ;
83- }
84- this .pollInterval = setInterval (
85- this .fetchStatus ,
86- this .localCheckInterval ,
87- );
88- },
89- stopStatusPolling : function () {
90- if (this .pollInterval ) {
91- clearInterval (this .pollInterval );
92- }
93- },
9475 loadCachedSession : function () {
9576 try {
9677 const cachedSession = localStorage .getItem (
0 commit comments