Update server.py

This commit is contained in:
Nova Cat 2024-12-15 19:39:41 -08:00
parent cd10e8ae90
commit 282818f5dc

View file

@ -520,24 +520,14 @@ def session(connection, client):
pass
cleanup_manual()
def cleanup():
global channels_list
global property_list
while True:
time.sleep(15)
print("Cleaning up...")
for i, j in channels_list.items():
for h in i:
if not h in property_list:
print("Found a detached connection: " + h)
i.remove(h)
for k in channels_list[j]:
if k != h and k in nickname_list:
nickname[k].sendall(f":{h}!~DISCONNECTED@DISCONNECTED PART {j} :IRCat Cleanup: Found missing connection!!\r\n")
cleanup_manual()
def cleanup_manual():
global channels_list
global property_list
print("Cleaning up...")
for i, j in channels_list.items():
for j, i in channels_list.items():
for h in i:
if not h in property_list:
print("Found a detached connection: " + h)