mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-07-18 00:55:50 +00:00
Add guard to remove_connection()
- multi_worker_connection_manager.py: Add missing count > 0 guard to multi-worker remove_connection() This method doesn't appear to be called anywhere but added the guard in case it is put back into service
This commit is contained in:
parent
9e8f227f49
commit
cf96287c90
1 changed files with 3 additions and 1 deletions
|
|
@ -1263,12 +1263,14 @@ class MultiWorkerVODConnectionManager:
|
|||
profile_id = connection_data.get('m3u_profile_id')
|
||||
if profile_id:
|
||||
profile_connections_key = f"profile_connections:{profile_id}"
|
||||
current_count = int(self.redis_client.get(profile_connections_key) or 0)
|
||||
|
||||
# Use pipeline for atomic operations
|
||||
pipe = self.redis_client.pipeline()
|
||||
pipe.delete(connection_key)
|
||||
pipe.srem(content_connections_key, client_id)
|
||||
pipe.decr(profile_connections_key)
|
||||
if current_count > 0:
|
||||
pipe.decr(profile_connections_key)
|
||||
pipe.execute()
|
||||
|
||||
logger.info(f"Removed Redis-backed connection: {client_id}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue