mirror of
https://github.com/Mrs4s/go-cqhttp.git
synced 2025-05-08 04:55:55 +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:
parent
4cddc5051f
commit
960f7ab79b
@ -191,9 +191,13 @@ func runWSClient(b *coolq.CQBot, node yaml.Node) {
|
|||||||
filter: conf.Filter,
|
filter: conf.Filter,
|
||||||
}
|
}
|
||||||
filter.Add(c.filter)
|
filter.Add(c.filter)
|
||||||
|
|
||||||
if conf.ReconnectInterval != 0 {
|
if conf.ReconnectInterval != 0 {
|
||||||
c.reconnectInterval = time.Duration(conf.ReconnectInterval) * time.Millisecond
|
c.reconnectInterval = time.Duration(conf.ReconnectInterval) * time.Millisecond
|
||||||
|
} else {
|
||||||
|
c.reconnectInterval = time.Second * 5
|
||||||
}
|
}
|
||||||
|
|
||||||
if conf.RateLimit.Enabled {
|
if conf.RateLimit.Enabled {
|
||||||
c.limiter = rateLimit(conf.RateLimit.Frequency, conf.RateLimit.Bucket)
|
c.limiter = rateLimit(conf.RateLimit.Frequency, conf.RateLimit.Bucket)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user