Skip to content

Commit f7a6802

Browse files
authored
Fix UI hang from refreshing params too fast (#1080)
* Hacky fix for params load * More stable solution * For some reason this is KEY * Add back condition so loop can be ended externally * Found the bug! * Handle edge cases
1 parent 0000d1a commit f7a6802

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

radio/app/controllers/paramsController.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,11 @@ def getAllParams(self) -> None:
120120
)
121121
self.getAllParamsThread.start()
122122

123+
# Wait so param_fetch_all doesn't silently return
124+
start = getattr(self.drone.master, "param_fetch_start", 0.0)
125+
elapsed = time.time() - start
126+
time.sleep(max(0.0, 2.0 - elapsed))
127+
123128
self.drone.master.param_fetch_all()
124129

125130
def getAllParamsThreadFunc(self) -> None:

0 commit comments

Comments
 (0)