osamabyc86 commited on
Commit
68884c4
·
verified ·
1 Parent(s): f56ca77

Update peer_discovery.py

Browse files
Files changed (1) hide show
  1. peer_discovery.py +6 -3
peer_discovery.py CHANGED
@@ -7,20 +7,23 @@ import logging
7
  import requests
8
  from zeroconf import Zeroconf, ServiceInfo, ServiceBrowser
9
  import random
10
- rport = {"7520", "7384" ,"9021" ,"6998" ,"5810" ,"9274" ,"8645" ,"7329" ,"7734" ,"8456" ,"6173","7860" }
11
  # 👇 إعداد الـ peer discovery عبر LAN وInternet
12
  SERVICE = "_tasknode._tcp.local."
13
  PORT = int(os.getenv("CPU_PORT", random.choice(list(rport))))
14
  PEERS = set() # مجموعة URLs للأقران (/run)
15
 
16
  # 🌐 قائمة السيرفرات (Failover List)
17
- CENTRAL_REGISTRY_SERVERS = [
18
  "https://cv4790811.regru.cloud",
19
  "https://amaloffload.onrender.com",
20
  "https://osamabyc86-offload.hf.space",
21
  "http://10.229.36.125",
22
- "http://10.229.228.178"
23
  ]
 
 
 
24
  current_server_index = 0
25
 
26
 
 
7
  import requests
8
  from zeroconf import Zeroconf, ServiceInfo, ServiceBrowser
9
  import random
10
+ rport = {"7520", "7384" ,"9021" ,"6998" ,"5810" ,"9274" ,"8645" ,"7329" ,"7734" ,"8456" ,"6173","7860" ,"8000" }
11
  # 👇 إعداد الـ peer discovery عبر LAN وInternet
12
  SERVICE = "_tasknode._tcp.local."
13
  PORT = int(os.getenv("CPU_PORT", random.choice(list(rport))))
14
  PEERS = set() # مجموعة URLs للأقران (/run)
15
 
16
  # 🌐 قائمة السيرفرات (Failover List)
17
+ BASES = [
18
  "https://cv4790811.regru.cloud",
19
  "https://amaloffload.onrender.com",
20
  "https://osamabyc86-offload.hf.space",
21
  "http://10.229.36.125",
22
+ "http://10.229.228.178",
23
  ]
24
+
25
+ CENTRAL_REGISTRY_SERVERS = [f"{base}:{port}" for base in BASES for port in rport]
26
+
27
  current_server_index = 0
28
 
29