summaryrefslogtreecommitdiffstats
path: root/devel
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-11-16 05:03:01 +0100
committerDan McGee <dan@archlinux.org>2011-11-16 05:03:01 +0100
commitd3b36e1ce992a8b70f4fe8fe9e8df74e835fb865 (patch)
tree58dfc0ff3eb4abd303bcf3645b5d4a66a17133a9 /devel
parent2a2df0074e39a797a0a4b5f7db7cfc9097301328 (diff)
downloadarchweb-d3b36e1ce992a8b70f4fe8fe9e8df74e835fb865.tar.gz
archweb-d3b36e1ce992a8b70f4fe8fe9e8df74e835fb865.tar.xz
reporead_inotify: cancel threads that haven't started yet on shutdown
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'devel')
-rwxr-xr-xdevel/management/commands/reporead_inotify.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/devel/management/commands/reporead_inotify.py b/devel/management/commands/reporead_inotify.py
index 135c036..4c865ce 100755
--- a/devel/management/commands/reporead_inotify.py
+++ b/devel/management/commands/reporead_inotify.py
@@ -54,6 +54,11 @@ class Command(BaseCommand):
logger.info('Entering notifier loop')
notifier.loop()
+ logger.info('Cancelling remaining threads...')
+ for thread in threading.enumerate():
+ if hasattr(thread, 'cancel'):
+ thread.cancel()
+
def setup_notifier(self):
'''Set up and configure the inotify machinery and logic.
This takes the provided or default path_template and builds a list of