1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-05-07 12:43:31 +08: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:
Mrs4s 2023-01-11 06:05:38 +08:00
parent 4cddc5051f
commit 960f7ab79b
No known key found for this signature in database
GPG Key ID: 3186E98FA19CE3A7

View File

@ -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)
}