From db76f01d482680fe4ec3dd43ec0b03958d0f7009 Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Tue, 14 Aug 2012 17:41:26 +0200 Subject: [PATCH] Stop application when aborting timed out. Only used on the command line. --- linkcheck/director/aggregator.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/linkcheck/director/aggregator.py b/linkcheck/director/aggregator.py index 9e26597d..88374f73 100644 --- a/linkcheck/director/aggregator.py +++ b/linkcheck/director/aggregator.py @@ -92,10 +92,12 @@ class Aggregate (object): """Print still-active URLs and empty the URL queue.""" self.print_active_threads() self.cancel() + timneout = self.config["timeout"] try: - self.urlqueue.join(timeout=self.config["timeout"]) + self.urlqueue.join(timeout=timeout) except urlqueue.Timeout: - log.warn(LOG_CHECK, "Abort timed out") + log.warn(LOG_CHECK, "Abort timed out after %d seconds, stopping application." % timeout) + raise KeyboardInterrupt() @synchronized(_threads_lock) def remove_stopped_threads (self):