mirror of
https://github.com/aclist/dztui.git
synced 2026-11-05 09:34:46 +01:00
chore: abstract cancel check function to controller
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
Mirror to Codeberg / mirror-to-codeberg (push) Has been cancelled
This commit is contained in:
1 parent
b615869278
commit
9fa2840d1b
3 files changed
+15
-30
No files matched your search
@@ -138,13 +138,9 @@ class ServerModelManager:
|
||||
futures = [executor.submit(Servers.test_ip, i, port, event) for i in ports]
|
||||
for future in as_completed(futures):
|
||||
try:
|
||||
if self.controller.get_exit_event().is_set():
|
||||
if self.controller.is_cancel_pending():
|
||||
event.set()
|
||||
return
|
||||
if self.controller.get_cancel_event().is_set():
|
||||
event.set()
|
||||
self.controller.clear_cancel_event()
|
||||
return
|
||||
res = future.result(timeout=LAN_TIMEOUT)
|
||||
if res is None:
|
||||
continue
|
||||
|
||||
Reference in new issue
Block a user