proxywatchd: make peak_rate per-session, not persistent
All checks were successful
CI / syntax-check (push) Successful in 6s
CI / memory-leak-check (push) Successful in 14s

This commit is contained in:
Username
2025-12-25 18:54:05 +01:00
parent 92b4036c37
commit b41d077905

View File

@@ -590,9 +590,7 @@ class Stats():
self.proto_passed['socks4'] = state.get('proto_socks4_passed', 0)
self.proto_tested['socks5'] = state.get('proto_socks5_tested', 0)
self.proto_passed['socks5'] = state.get('proto_socks5_passed', 0)
# Cap peak_rate at reasonable maximum (corrupted values from bugs)
raw_peak = state.get('peak_rate', 0.0)
self.peak_rate = min(raw_peak, 100.0) # Max 100/s is generous
# Note: peak_rate is per-session, not restored (avoids stale/corrupt values)
# Note: start_time is NOT restored - uptime reflects current session
# Restore failure categories
if state.get('fail_categories'):