mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-06-05 12:44:22 +00:00
XrayTrafficJob and NodeTrafficSyncJob both gated the entire post-traffic-write block behind websocket.HasClients() to skip expensive broadcasts when no browser is open. The block included the RefreshOnlineClientsFromMap call that keeps the in-memory p.onlineClients list current. Several non-WS consumers read that same list: - Telegram bot (tgbot.go calls p.GetOnlineClients in 3 places) - REST GET /panel/api/onlines (returned to API callers) - Internal alerts that check whether a client is online When no browser was watching the dashboard, the list went stale and stayed empty, so the bot reported "nobody online" and the onlines API returned [] even when xray had active sessions. Move RefreshOnlineClientsFromMap above the HasClients guard so the in-memory list is always fresh. Only the actual BroadcastTraffic / BroadcastClientStats / BroadcastOutbounds calls (and the GetAllClientTraffics / GetInboundsTrafficSummary work that feeds them) remain gated by HasClients. Closes #4515 |
||
|---|---|---|
| .. | ||
| check_client_ip_job.go | ||
| check_client_ip_job_integration_test.go | ||
| check_client_ip_job_test.go | ||
| check_cpu_usage.go | ||
| check_hash_storage.go | ||
| check_hash_storage_test.go | ||
| check_xray_running_job.go | ||
| clear_logs_job.go | ||
| ldap_sync_job.go | ||
| node_heartbeat_job.go | ||
| node_traffic_sync_job.go | ||
| node_traffic_sync_job_test.go | ||
| periodic_traffic_reset_job.go | ||
| stats_notify_job.go | ||
| xray_traffic_job.go | ||