Restore debug handler
This commit is contained in:
+23
-1
@@ -78,7 +78,7 @@ func (s *Storage) Put(queue string, message []byte) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
func (s *Storage) Info() map[string]uint {
|
||||
func (s *Storage) QueueSizes() map[string]uint {
|
||||
info := make(map[string]uint)
|
||||
|
||||
for queue, c := range s.counters {
|
||||
@@ -88,6 +88,28 @@ func (s *Storage) Info() map[string]uint {
|
||||
return info
|
||||
}
|
||||
|
||||
func (s *Storage) Info() map[string]interface{} {
|
||||
info := make(map[string]interface{})
|
||||
status, err := s.kyoto.Status()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
status = status[:len(status)-1] // Removing trailing new line
|
||||
tokens := strings.Split(status, "\n")
|
||||
for _, t := range tokens {
|
||||
tt := strings.Split(t, "\t")
|
||||
num, err := strconv.Atoi(tt[1])
|
||||
if err != nil {
|
||||
info[tt[0]] = tt[1]
|
||||
} else {
|
||||
info[tt[0]] = num
|
||||
}
|
||||
}
|
||||
|
||||
return info
|
||||
}
|
||||
|
||||
func (s *Storage) Close() (err error) {
|
||||
if err = s.kyoto.Sync(true); err != nil {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user