Browse Source

dont access storage on non running servers for metrics (segfault)

pull/28/head
Dan Ballard 4 weeks ago
parent
commit
91bb48e82c
  1. 9
      server.go

9
server.go

@ -193,10 +193,13 @@ type Statistics struct {
// GetStatistics is a stub method for providing some high level information about
// the server operation to bundling applications (e.g. the UI)
func (s *server) GetStatistics() Statistics {
return Statistics{
TotalMessages: s.messageStore.MessagesCount(),
TotalConnections: s.service.Metrics().ConnectionCount,
if s.running {
return Statistics{
TotalMessages: s.messageStore.MessagesCount(),
TotalConnections: s.service.Metrics().ConnectionCount,
}
}
return Statistics{}
}
func (s *server) Delete(password string) error {

Loading…
Cancel
Save