fix: scheduler polling unchanged task list

Alessandro committed Dec 22, 2025 at 05:41 UTC 4fecec06621b0444a8f8e5e9e767033f80fd12a1
1 file changed +7 -2
webui/components/settings/scheduler/scheduler-store.js
+7 -2
@@ -549,11 +549,12 @@ const schedulerStoreModel = {
549 startPolling() {
550 if (this.pollingInterval) return;
551 this.fetchTasks();
552 + // Poll every 5 seconds - balances responsiveness with performance
553 this.pollingInterval = setInterval(() => {
554 if (this.pollingActive) {
555 this.fetchTasks();
556 }
556 - }, 2000);
557 + }, 5000);
558 },
559
560 stopPolling() {
@@ -576,7 +577,11 @@ const schedulerStoreModel = {
577 this.hasNoTasks = true;
578 return;
579 }
579 - this.tasks = tasks;
580 + // Only update if data actually changed - prevents DOM thrashing during polling
581 + const newJson = JSON.stringify(tasks);
582 + if (newJson !== JSON.stringify(this.tasks)) {
583 + this.tasks = tasks;
584 + }
585 this.hasNoTasks = tasks.length === 0;
586 } catch (error) {
587 if (manual) this.notifyError(`Failed to fetch tasks: ${error.message}`);