Skip to content

Commit

Permalink
fix: runtime error in remove_old_paused
Browse files Browse the repository at this point in the history
  • Loading branch information
itschasa committed Jun 15, 2024
1 parent 34ef5f8 commit 3ec1cad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/media_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def process_session(self, bandwidth: int, paused: bool, ip_address: str, session


def remove_old_paused(self, active_session_ids: list[str]) -> None:
for session_id in self._paused_since:
for session_id in self._paused_since.copy(): # Copy to prevent RuntimeError: dictionary changed size during iteration
if session_id not in active_session_ids:
logger.debug(f"{self._logger_prefix} Removing {session_id} from paused_since, no longer in session list")
del self._paused_since[session_id]
Expand Down

0 comments on commit 3ec1cad

Please sign in to comment.