Spaces:
Running
Running
Commit
·
85bf3ba
1
Parent(s):
4718e29
Slight Edit
Browse files
FileStream/bot/__init__.py
CHANGED
@@ -26,7 +26,7 @@ ACTIVE_CLIENTS = {}
|
|
26 |
async def req_client(PUBLIC_IP:str)-> dict:
|
27 |
index = min(WORK_LOADS, key=WORK_LOADS.get)
|
28 |
faster_client = MULTI_CLIENTS[index]
|
29 |
-
|
30 |
#ACTIVE_CLIENTS.update(faster_client)
|
31 |
#response = dict(index=index, client=faster_client)
|
32 |
return dict(index=index,public_ip=PUBLIC_IP, client=faster_client)
|
|
|
26 |
async def req_client(PUBLIC_IP:str)-> dict:
|
27 |
index = min(WORK_LOADS, key=WORK_LOADS.get)
|
28 |
faster_client = MULTI_CLIENTS[index]
|
29 |
+
logging.info("\n \nFaster Client",faster_client,type(faster_client),"\nWORK_LOADS",WORK_LOADS,type(WORK_LOADS),"\nMULTI_CLIENTS",MULTI_CLIENTS,type(MULTI_CLIENTS),"\n")
|
30 |
#ACTIVE_CLIENTS.update(faster_client)
|
31 |
#response = dict(index=index, client=faster_client)
|
32 |
return dict(index=index,public_ip=PUBLIC_IP, client=faster_client)
|
FileStream/server/Functions/downloader.py
CHANGED
@@ -31,13 +31,13 @@ async def media_streamer(request: web.Request, db_id: str, speed: str):
|
|
31 |
# Use an existing ByteStreamer or create a new one
|
32 |
#tg_connect = ACTIVE_CLIENTS.get(client['client'], None)
|
33 |
|
34 |
-
if client[
|
35 |
logging.info(f"Creating new ByteStreamer object for client {client['index']}")
|
36 |
-
tg_connect = ACTIVE_CLIENTS(client[
|
37 |
|
38 |
else:
|
39 |
-
tg_connect = utils.ByteStreamer(client[
|
40 |
-
ACTIVE_CLIENTS[client[
|
41 |
logging.info(f"Using cached ByteStreamer object for client {client['index']}")
|
42 |
|
43 |
tg_connect.update_last_activity()
|
|
|
31 |
# Use an existing ByteStreamer or create a new one
|
32 |
#tg_connect = ACTIVE_CLIENTS.get(client['client'], None)
|
33 |
|
34 |
+
if client["client"] in ACTIVE_CLIENTS:
|
35 |
logging.info(f"Creating new ByteStreamer object for client {client['index']}")
|
36 |
+
tg_connect = ACTIVE_CLIENTS(client["client"])
|
37 |
|
38 |
else:
|
39 |
+
tg_connect = utils.ByteStreamer(client["client"])
|
40 |
+
ACTIVE_CLIENTS[client["client"]] = tg_connect
|
41 |
logging.info(f"Using cached ByteStreamer object for client {client['index']}")
|
42 |
|
43 |
tg_connect.update_last_activity()
|