mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-07-18 00:55:50 +00:00
Update last_active timestamp in keepalive logic
Update last active timestamp for clients during failover.
This commit is contained in:
parent
10ea165c2c
commit
c8b665dc98
1 changed files with 5 additions and 0 deletions
|
|
@ -312,6 +312,11 @@ class StreamGenerator:
|
|||
self.bytes_sent += len(keepalive_packet)
|
||||
self.last_yield_time = time.time()
|
||||
self.consecutive_empty = 0 # Reset consecutive counter but keep total empty_reads
|
||||
# Update last_active so clients waiting during failover aren't flagged as ghosts
|
||||
proxy_server = ProxyServer.get_instance()
|
||||
if proxy_server and proxy_server.redis_client:
|
||||
client_key = RedisKeys.client_metadata(self.channel_id, self.client_id)
|
||||
proxy_server.redis_client.hset(client_key, "last_active", str(time.time()))
|
||||
gevent.sleep(Config.KEEPALIVE_INTERVAL) # Replace time.sleep
|
||||
else:
|
||||
# Standard wait with backoff
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue