mirror of
https://github.com/kc1awv/rrcd.git
synced 2026-08-18 09:48:35 -04:00
implement resource cleanup loop
missing a loop for periodic cleanup of expired resource expectations, whoops.
This commit is contained in:
parent
2d0517c478
commit
df386d1d6a
1 changed files with 12 additions and 0 deletions
|
|
@ -1862,6 +1862,18 @@ class HubService:
|
|||
for room in rooms_to_prune:
|
||||
self.log.info("Pruned unused registered room %s", room)
|
||||
|
||||
def _resource_cleanup_loop(self) -> None:
|
||||
"""Periodically cleanup expired resource expectations."""
|
||||
while not self._shutdown.is_set():
|
||||
# Run cleanup every 30 seconds
|
||||
time.sleep(30.0)
|
||||
if self._shutdown.is_set():
|
||||
break
|
||||
try:
|
||||
self._cleanup_all_expired_expectations()
|
||||
except Exception:
|
||||
self.log.exception("Resource cleanup failed")
|
||||
|
||||
def _config_path_for_writes(self) -> str | None:
|
||||
p = self.config.config_path
|
||||
if not p:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue