aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorterminaldweller <thabogre@gmail.com>2023-03-02 16:47:27 +0000
committerterminaldweller <thabogre@gmail.com>2023-03-02 16:47:27 +0000
commitee2b61688fd023b8404843ecb4dca51d480ae62f (patch)
tree294d5d009490f690a1a616af4bfa9a04c7ba8bc9
parentfixed a bug with the t keybinding where we were using the entire line as the ... (diff)
downloadtunneltop-ee2b61688fd023b8404843ecb4dca51d480ae62f.tar.gz
tunneltop-ee2b61688fd023b8404843ecb4dca51d480ae62f.zip
fixed the quit bug where we were waiting on cancelled asyncio tasks
-rw-r--r--pyproject.toml2
-rwxr-xr-xtunneltop/tunneltop.py7
2 files changed, 4 insertions, 5 deletions
diff --git a/pyproject.toml b/pyproject.toml
index be76317..ad57e70 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[tool.poetry]
name = "tunneltop"
-version = "0.3.5"
+version = "0.3.6"
description = "A top-like tunnel manager"
authors = ["terminaldweller <devi@terminaldweller.com>"]
license = "GPL-3.0"
diff --git a/tunneltop/tunneltop.py b/tunneltop/tunneltop.py
index ecbbaa8..984f6c9 100755
--- a/tunneltop/tunneltop.py
+++ b/tunneltop/tunneltop.py
@@ -521,13 +521,12 @@ class TunnelManager:
# when we want to quit
self.are_we_dying = True
+ # we don't have a task hierarchy so we just kill all
+ # of them without having to kill the descendants first
for task in asyncio.all_tasks():
task.cancel()
await asyncio.sleep(0)
- try:
- await asyncio.gather(*asyncio.all_tasks())
- finally:
- sys.exit(0)
+ await asyncio.sleep(1)
async def revive_failed_tasks(self) -> None:
"""Revives failed tasks"""