Skip to content

Commit

Permalink
fix: set separate timeout for source fetching
Browse files Browse the repository at this point in the history
  • Loading branch information
medanisjbara committed Aug 16, 2023
1 parent b01966f commit 3cea21a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions openweb_proxy/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
PROXY_PROTOCOL = "socks5"
DEFAULT_PROXY = "https://localhost:3128"
TIMEOUT = 5
SOURCE_TIMEOUT = 20
MAX_WORKERS = 10

RE_URL = re.compile(r"^https?://", re.IGNORECASE)
Expand Down
2 changes: 1 addition & 1 deletion openweb_proxy/proxy_miner.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def __init__(
def _get_proxies(self, url: str) -> None:
"""Get proxies list from github and al"""
try:
r = requests.get(url, timeout=self.timeout)
r = requests.get(url, timeout=config.SOURCE_TIMEOUT)
self.proxies.update(
{
f"{self.protocol}://{proxy.group(1)}"
Expand Down

0 comments on commit 3cea21a

Please sign in to comment.