diff options
author | Dan McGee <dan@archlinux.org> | 2011-11-15 22:03:01 -0600 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-11-15 22:03:01 -0600 |
commit | d3b36e1ce992a8b70f4fe8fe9e8df74e835fb865 (patch) | |
tree | 58dfc0ff3eb4abd303bcf3645b5d4a66a17133a9 /devel/management/commands | |
parent | 2a2df0074e39a797a0a4b5f7db7cfc9097301328 (diff) |
reporead_inotify: cancel threads that haven't started yet on shutdown
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'devel/management/commands')
-rwxr-xr-x | devel/management/commands/reporead_inotify.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/devel/management/commands/reporead_inotify.py b/devel/management/commands/reporead_inotify.py index 135c0367..4c865ce1 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 |