mirror of
https://github.com/Flowseal/tg-ws-proxy.git
synced 2026-05-22 23:41:44 +03:00
Refresh domains schedule
This commit is contained in:
@@ -87,12 +87,21 @@ def refresh_cfproxy_domains() -> None:
|
|||||||
proxy_config.active_cfproxy_domain = random.choice(pool)
|
proxy_config.active_cfproxy_domain = random.choice(pool)
|
||||||
|
|
||||||
|
|
||||||
|
_refresh_stop: threading.Event = threading.Event()
|
||||||
|
|
||||||
|
|
||||||
def start_cfproxy_domain_refresh() -> None:
|
def start_cfproxy_domain_refresh() -> None:
|
||||||
threading.Thread(
|
global _refresh_stop
|
||||||
target=refresh_cfproxy_domains,
|
_refresh_stop.set()
|
||||||
daemon=True,
|
_refresh_stop = threading.Event()
|
||||||
name='cfproxy-domains-refresh',
|
stop = _refresh_stop
|
||||||
).start()
|
|
||||||
|
def _loop():
|
||||||
|
refresh_cfproxy_domains()
|
||||||
|
while not stop.wait(timeout=3600):
|
||||||
|
refresh_cfproxy_domains()
|
||||||
|
|
||||||
|
threading.Thread(target=_loop, daemon=True, name='cfproxy-domains-refresh').start()
|
||||||
|
|
||||||
|
|
||||||
def parse_dc_ip_list(dc_ip_list: List[str]) -> Dict[int, str]:
|
def parse_dc_ip_list(dc_ip_list: List[str]) -> Dict[int, str]:
|
||||||
|
|||||||
Reference in New Issue
Block a user