fix: keep load test websocket sessions alive

This commit is contained in:
richjohnrambo
2026-09-27 21:41:50 +08:00
parent bde02e8eac
commit ea8732e2b1
7 changed files with 111 additions and 1 deletions
+7
View File
@@ -25,6 +25,7 @@ type Config struct {
PrepareWorkers int `json:"prepare_workers"`
ConnectRamp string `json:"connect_ramp"`
CommandTimeout string `json:"command_timeout"`
WSPingInterval string `json:"ws_ping_interval"`
P2PMessages int `json:"p2p_messages_per_user"`
P2PInterval string `json:"p2p_interval"`
DrainP2P string `json:"drain_p2p"`
@@ -62,6 +63,12 @@ func loadConfig(path string) (*Config, error) {
if cfg.CommandTimeout == "" {
cfg.CommandTimeout = "20s"
}
if cfg.WSPingInterval == "" {
cfg.WSPingInterval = "20s"
}
if _, err = configDuration(cfg.WSPingInterval); err != nil {
return nil, fmt.Errorf("ws_ping_interval: %w", err)
}
if cfg.P2PMessages <= 0 {
cfg.P2PMessages = 10
}