实现在心跳中采集各设备信息
This commit is contained in:
@@ -83,6 +83,9 @@ type WebSocketConfig struct {
|
||||
type HeartbeatConfig struct {
|
||||
// Interval 心跳间隔(秒)
|
||||
Interval int `yaml:"interval"`
|
||||
|
||||
// Concurrency 请求并发数
|
||||
Concurrency int `yaml:"concurrency"`
|
||||
}
|
||||
|
||||
// NewConfig 创建并返回一个新的配置实例
|
||||
@@ -135,10 +138,7 @@ func (c *Config) GetWebSocketTimeout() int {
|
||||
return c.WebSocket.Timeout
|
||||
}
|
||||
|
||||
// GetHeartbeatInterval 获取心跳间隔(秒)
|
||||
func (c *Config) GetHeartbeatInterval() int {
|
||||
if c.Heartbeat.Interval <= 0 {
|
||||
return 30 // 默认30秒心跳间隔
|
||||
}
|
||||
return c.Heartbeat.Interval
|
||||
// GetHeartbeatConfig 获取心跳配置
|
||||
func (c *Config) GetHeartbeatConfig() HeartbeatConfig {
|
||||
return c.Heartbeat
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user