mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-05-18 11:31:06 +00:00
Shutdown immediately when Ctrl-C is given twice
Try sys.exit() to shutdown immediately after Ctrl-C keyboard interrupt was given twice. git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@3695 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
8ae6d94b45
commit
9c56f03ae3
2 changed files with 5 additions and 6 deletions
5
TODO
5
TODO
|
|
@ -1,8 +1,3 @@
|
||||||
- [FEATURE] Hit Ctrl-C once displays active URLs and waits for a timeout.
|
|
||||||
Hitting it *again* after that should shut down immediately, not caring
|
|
||||||
about cleanup. Here is a starting point recipe:
|
|
||||||
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496735
|
|
||||||
|
|
||||||
- [BUG REPORT] the web interface only runs on the server it is installed on.
|
- [BUG REPORT] the web interface only runs on the server it is installed on.
|
||||||
The ALLOWED_HOSTS and ALLOWED_SERVERS variables in lc.cgi don't work and
|
The ALLOWED_HOSTS and ALLOWED_SERVERS variables in lc.cgi don't work and
|
||||||
are not (well) documented.
|
are not (well) documented.
|
||||||
|
|
|
||||||
|
|
@ -74,6 +74,8 @@ def interrupt (aggregate):
|
||||||
try:
|
try:
|
||||||
linkcheck.log.warn(linkcheck.LOG_CHECK,
|
linkcheck.log.warn(linkcheck.LOG_CHECK,
|
||||||
_("keyboard interrupt; waiting for active threads to finish"))
|
_("keyboard interrupt; waiting for active threads to finish"))
|
||||||
|
linkcheck.log.warn(linkcheck.LOG_CHECK,
|
||||||
|
_("another keyboard interrupt will exit immediately"))
|
||||||
print_active_threads(aggregate)
|
print_active_threads(aggregate)
|
||||||
abort(aggregate)
|
abort(aggregate)
|
||||||
break
|
break
|
||||||
|
|
@ -100,8 +102,10 @@ def abort (aggregate):
|
||||||
aggregate.logger.end_log_output()
|
aggregate.logger.end_log_output()
|
||||||
break
|
break
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
linkcheck.log.warn(linkcheck.LOG_CHECK, _("shutdown in progress"))
|
linkcheck.log.warn(linkcheck.LOG_CHECK, _("keyboard interrupt; force shutdown"))
|
||||||
print_active_threads(aggregate)
|
print_active_threads(aggregate)
|
||||||
|
import sys
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
def get_aggregate (config):
|
def get_aggregate (config):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue