add servers cleanup by timeout

This commit is contained in:
ghost 2024-01-09 04:10:47 +02:00
parent 2b6872e04f
commit 65e8183817
1 changed files with 5 additions and 0 deletions

View File

@ -92,6 +92,11 @@ class PyMaster:
for i in self.serverList:
# Cleanup servers by timeout
if time() > i.die:
self.serverList.remove(i)
continue
# Use pregenerated address string
packet += i.queryAddr