Skip to content

Commit bb7fb82

Browse files
committed
refactor(utils): tidy imports and update public-ip cache path in get_public_ip
- Reorder and simplify imports (group stdlib imports, tighten typing to `Any`/`Dict`). - Replace `tempfile` usage and adjust import ordering for clarity. - Change `FileCache`/`send_query` import order to `QueryResult, send_query`. - Update cache directory path from "/tmp/runners/public-ip" to "/tmp/caches/public-ip". - Minor whitespace and formatting cleanups. This is a non-functional refactor that improves code organization and standardizes the temporary cache location.
1 parent 993557e commit bb7fb82

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

‎proxy_checker/utils/get_public_ip.py‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
import os
2-
import json
3-
import time
41
import hashlib
2+
import json
3+
import os
54
import re
6-
import tempfile
7-
from typing import Optional, Dict, Any, List
8-
from .curl import send_query, QueryResult
9-
5+
import time
6+
from typing import Any, Dict
7+
from .curl import QueryResult, send_query
108

119
IP_REGEX = re.compile(
1210
r"(?!0)(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}"
@@ -35,7 +33,7 @@ def get_public_ip(
3533
) -> str:
3634

3735
# ------------ CACHE HANDLING ------------
38-
cache_dir = os.path.join("/tmp", "runners", "public-ip")
36+
cache_dir = os.path.join("/tmp/caches/public-ip")
3937
os.makedirs(cache_dir, exist_ok=True)
4038

4139
proxy_key = (

0 commit comments

Comments
 (0)