summaryrefslogtreecommitdiff
path: root/crocoite
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2018-10-30 16:53:31 +0100
committerLars-Dominik Braun <lars@6xq.net>2018-10-30 16:54:43 +0100
commitd61998a5196f8655e4a9303e19cf233b9d096b3f (patch)
treead2f5410cb966cbe4f7b0fae3e8eaa46333f82fe /crocoite
parentb82991172968e665fa5882742148a675cf880135 (diff)
downloadcrocoite-d61998a5196f8655e4a9303e19cf233b9d096b3f.tar.gz
crocoite-d61998a5196f8655e4a9303e19cf233b9d096b3f.tar.bz2
crocoite-d61998a5196f8655e4a9303e19cf233b9d096b3f.zip
recursive: Actually stop the grab when canceled
This change was lost during the merge of 958563a3602780b48599c27acf212139c2e6904d.
Diffstat (limited to 'crocoite')
-rw-r--r--crocoite/controller.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/crocoite/controller.py b/crocoite/controller.py
index dd39c1d..fc5b62b 100644
--- a/crocoite/controller.py
+++ b/crocoite/controller.py
@@ -386,7 +386,7 @@ class RecursiveController:
self.have = set ()
self.pending = set ([self.url])
- while self.pending:
+ while self.pending and not self._quit:
# since pending is a set this picks a random item, which is fine
u = self.pending.pop ()
self.have.add (u)
@@ -400,5 +400,7 @@ class RecursiveController:
return_when=asyncio.FIRST_COMPLETED)
self.running.difference_update (done)
+ done = asyncio.gather (*self.running)
+ self.running = set ()
log ()