Closes issue #23
This commit is contained in:
parent
48abfbba8c
commit
7086eeac1b
1 changed files with 12 additions and 2 deletions
10
main.py
10
main.py
|
@ -31,6 +31,7 @@ import requests
|
|||
import threading
|
||||
import signal
|
||||
import socket
|
||||
import sys
|
||||
from functools import partial
|
||||
from concurrent.futures import ThreadPoolExecutor, as_completed
|
||||
from bs4 import BeautifulSoup
|
||||
|
@ -199,6 +200,15 @@ def logURLLog(hostname, logTime, url, responseTime):
|
|||
|
||||
def main():
|
||||
|
||||
if sys.platform.startswith('win'):
|
||||
|
||||
import win32api
|
||||
|
||||
win32api.SetConsoleCtrlHandler(lambda sig, frame:
|
||||
|
||||
signal_handler(signal.CTRL_C_EVENT, frame), True)
|
||||
else:
|
||||
|
||||
signal.signal(signal.SIGTERM, signal_handler)
|
||||
signal.signal(signal.SIGINT, signal_handler)
|
||||
|
||||
|
|
Loading…
Reference in a new issue