def took_too_long():
"""
Called when :meth:`main` takes too long to run its course (idle timeout
before any connection was made).
"""
timeout_script = os.path.join(APPLICATION_PATH, 'timeout.sh')
sys.stdout.flush()
# Calling execv() so we can quit the main process to reduce memory usage
os.execv('/bin/sh', ['-c', timeout_script])
os._exit(0)
评论列表
文章目录