Agent: Lock RelayUserHandler.has_*_users()

This commit is contained in:
Mike Salvatore 2022-09-07 00:02:23 -04:00
parent 90dcb0a91e
commit e2736a9273
1 changed files with 10 additions and 8 deletions

View File

@ -76,6 +76,7 @@ class RelayUserHandler:
"""
Return whether or not we have any potential users.
"""
with self._lock:
self._potential_users = dict(
filter(lambda ru: not ru[1].timer.is_expired(), self._potential_users.items())
)
@ -86,6 +87,7 @@ class RelayUserHandler:
"""
Return whether or not we have any relay users.
"""
with self._lock:
self._relay_users = dict(
filter(lambda ru: not ru[1].timer.is_expired(), self._relay_users.items())
)