Skip to content

Commit cd266cf

Browse files
authored
Ui fix (#44)
* Fix UI issue, remove useless catch * Increase sleep to improve performance
1 parent 541b409 commit cd266cf

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/ui/prompt_ui.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import asyncio
22
import logging
33
import collections
4-
import concurrent
54
import os
65
from typing import Callable, List, Optional, Tuple
76
from yaml import safe_load
@@ -84,7 +83,7 @@ async def interact():
8483
except ConnectionError:
8584
log.info("Connection error in ssh UI, exiting.")
8685
ui.close()
87-
# raise
86+
raise
8887

8988
ssh_server = await asyncssh.create_server(
9089
lambda: PromptToolkitSSHServer(interact),
@@ -481,9 +480,7 @@ async def update_ui(self):
481480

482481
if self.app and not self.app.invalidated:
483482
self.app.invalidate()
484-
await asyncio.sleep(1)
485-
except concurrent.futures._base.CancelledError as e:
486-
log.warn(f"Cancelled error in UI: {type(e)}: {e}")
483+
await asyncio.sleep(1.5)
487484
except Exception as e:
488485
log.warn(f"Exception in UI update_ui {type(e)}: {e}")
489486
raise e
@@ -521,9 +518,7 @@ async def update_data(self):
521518
else (0, bytes(pk))
522519
for pk in self.pool_pks
523520
]
524-
await asyncio.sleep(5)
525-
except concurrent.futures._base.CancelledError as e:
526-
log.warn(f"Cancelled error in UI: {type(e)}: {e}")
521+
await asyncio.sleep(7.5)
527522
except Exception as e:
528523
log.warn(f"Exception in UI update_data {type(e)}: {e}")
529524
raise e

0 commit comments

Comments
 (0)