瀏覽代碼

fix touch app polling

tuanchris 3 月之前
父節點
當前提交
f2f4aec87e
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      dune-weaver-touch/backend.py

+ 8 - 0
dune-weaver-touch/backend.py

@@ -256,9 +256,17 @@ class Backend(QObject):
                             print(f"🎨 Cache generation started: {self._cache_progress['total']} patterns")
                             print(f"🎨 Cache generation started: {self._cache_progress['total']} patterns")
                         elif not self._cache_in_progress and was_in_progress:
                         elif not self._cache_in_progress and was_in_progress:
                             print(f"✅ Cache generation completed!")
                             print(f"✅ Cache generation completed!")
+                            # Stop polling when cache generation completes
+                            if self._cache_progress_timer.isActive():
+                                self._cache_progress_timer.stop()
+                                print(f"🛑 Cache progress polling stopped")
 
 
         except Exception as e:
         except Exception as e:
             # Silently fail - cache progress is non-critical
             # Silently fail - cache progress is non-critical
+            # Stop polling on repeated errors to avoid log spam
+            if self._cache_progress_timer.isActive():
+                self._cache_progress_timer.stop()
+                print(f"🛑 Cache progress polling stopped due to error")
             pass
             pass
 
 
     # WebSocket handlers
     # WebSocket handlers