Skip to content

Commit 123ae87

Browse files
committed
fix: remove dependency on requests
1 parent 0c24215 commit 123ae87

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

bin/wireproxy_manager.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
import logging
88
import logging.config
99
import socket
10-
11-
import requests
10+
import urllib.request
1211

1312
from dataclasses import dataclass
1413
from logging import Logger
@@ -44,10 +43,11 @@ def stop(self) -> None:
4443

4544
def is_healthy(self) -> bool:
4645
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:
46+
with urllib.request.urlopen(f'http://{self.health_endpoint}/readyz') as response:
47+
if response.status == 200:
48+
self.failed_healthcheck = 0
49+
return True
50+
except urllib.error.HTTPError:
5151
self.failed_healthcheck += 1
5252
return False
5353
return True

0 commit comments

Comments
 (0)