From c42b0f8a51b944b358500fd70af5168fb508f5b4 Mon Sep 17 00:00:00 2001 From: vela-jabber Date: Sat, 17 Apr 2021 17:58:42 +0200 Subject: [PATCH] prometheus fix multithreading --- prometheus.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prometheus.py b/prometheus.py index 676b6fc..4ffbcfd 100755 --- a/prometheus.py +++ b/prometheus.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- import logging -from http.server import BaseHTTPRequestHandler, HTTPServer +from http.server import BaseHTTPRequestHandler, HTTPServer, ThreadingHTTPServer from socket import AF_INET6 from time import time from urllib.parse import parse_qs, urlparse @@ -126,7 +126,7 @@ class Prometheus: def listen(self, addr=("127.0.0.1", 8080)): if "::" in addr[0]: HTTPServer.address_family = AF_INET6 - server = HTTPServer(addr, DynamicMetricsHandler.factory(self.handler)) + server = ThreadingHTTPServer(addr, DynamicMetricsHandler.factory(self.handler)) server.serve_forever()