We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0c24215 commit 123ae87Copy full SHA for 123ae87
bin/wireproxy_manager.py
@@ -7,8 +7,7 @@
7
import logging
8
import logging.config
9
import socket
10
-
11
-import requests
+import urllib.request
12
13
from dataclasses import dataclass
14
from logging import Logger
@@ -44,10 +43,11 @@ def stop(self) -> None:
44
43
45
def is_healthy(self) -> bool:
46
try:
47
- r = requests.get(f'http://{self.health_endpoint}/readyz', timeout=2)
48
- r.raise_for_status()
49
- self.failed_healthcheck = 0
50
- except requests.exceptions.RequestException:
+ with urllib.request.urlopen(f'http://{self.health_endpoint}/readyz') as response:
+ if response.status == 200:
+ self.failed_healthcheck = 0
+ return True
+ except urllib.error.HTTPError:
51
self.failed_healthcheck += 1
52
return False
53
return True
0 commit comments