mirror of
https://github.com/ArchipelagoMW/Archipelago.git
synced 2026-03-21 06:45:49 -07:00
Update WebHostLib/customserver.py
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
This commit is contained in:
@@ -270,7 +270,7 @@ def get_active_net_connections() -> typing.Iterable[int]:
|
||||
|
||||
def get_used_ports():
|
||||
last_used_ports: tuple[frozenset[int], float] = getattr(get_used_ports, "last", None)
|
||||
t_hash = time.time() // 900
|
||||
t_hash = round(time.time() / 90) # cache for 90 seconds
|
||||
if last_used_ports is None or last_used_ports[1] != t_hash:
|
||||
last_used_ports = (frozenset(get_active_net_connections()), t_hash)
|
||||
setattr(get_used_ports, "last", last_used_ports)
|
||||
|
||||
Reference in New Issue
Block a user