Timeout REST API requests after 10 seconds

This commit is contained in:
jesopo 2018-10-04 17:10:05 +01:00
parent 57b72a94c5
commit a220ff8485

View file

@ -5,6 +5,7 @@ from src import utils
_bot = None _bot = None
_events = None _events = None
class Handler(http.server.BaseHTTPRequestHandler): class Handler(http.server.BaseHTTPRequestHandler):
timeout = 10
def do_GET(self): def do_GET(self):
_bot.lock.acquire() _bot.lock.acquire()
parsed = urllib.parse.urlparse(self.path) parsed = urllib.parse.urlparse(self.path)