mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Fixed interface conversion for ipQueue in monitor which caused panics.
Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
@@ -1120,14 +1120,17 @@ func (s *Server) HandleIPQueuesz(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
queues := map[string]monitorIPQueue{}
|
||||
|
||||
s.ipQueues.Range(func(k, v interface{}) bool {
|
||||
s.ipQueues.Range(func(k, v any) bool {
|
||||
var pending, inProgress int
|
||||
name := k.(string)
|
||||
queue := v.(interface {
|
||||
queue, ok := v.(interface {
|
||||
len() int
|
||||
inProgress() uint64
|
||||
inProgress() int64
|
||||
})
|
||||
pending := queue.len()
|
||||
inProgress := int(queue.inProgress())
|
||||
if ok {
|
||||
pending = queue.len()
|
||||
inProgress = int(queue.inProgress())
|
||||
}
|
||||
if !all && (pending == 0 && inProgress == 0) {
|
||||
return true
|
||||
} else if qfilter != _EMPTY_ && !strings.Contains(name, qfilter) {
|
||||
|
||||
Reference in New Issue
Block a user