mirror of
https://github.com/Mrs4s/go-cqhttp.git
synced 2025-07-06 22:23:25 +00:00
fix: when the reconnect-interval of ws-reverse is set to 0, push event will panic if has connection error
This commit is contained in:
@ -191,9 +191,13 @@ func runWSClient(b *coolq.CQBot, node yaml.Node) {
|
||||
filter: conf.Filter,
|
||||
}
|
||||
filter.Add(c.filter)
|
||||
|
||||
if conf.ReconnectInterval != 0 {
|
||||
c.reconnectInterval = time.Duration(conf.ReconnectInterval) * time.Millisecond
|
||||
} else {
|
||||
c.reconnectInterval = time.Second * 5
|
||||
}
|
||||
|
||||
if conf.RateLimit.Enabled {
|
||||
c.limiter = rateLimit(conf.RateLimit.Frequency, conf.RateLimit.Bucket)
|
||||
}
|
||||
|
Reference in New Issue
Block a user