Stop application when aborting timed out. Only used on the command line.

This commit is contained in:
Bastian Kleineidam 2012-08-14 17:41:26 +02:00
parent 2d2dedfdc2
commit db76f01d48

View file

@ -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):