dont access storage on non running servers for metrics (segfault)
This commit is contained in:
parent
92c4b25898
commit
91bb48e82c
|
@ -193,10 +193,13 @@ type Statistics struct {
|
||||||
// GetStatistics is a stub method for providing some high level information about
|
// GetStatistics is a stub method for providing some high level information about
|
||||||
// the server operation to bundling applications (e.g. the UI)
|
// the server operation to bundling applications (e.g. the UI)
|
||||||
func (s *server) GetStatistics() Statistics {
|
func (s *server) GetStatistics() Statistics {
|
||||||
return Statistics{
|
if s.running {
|
||||||
TotalMessages: s.messageStore.MessagesCount(),
|
return Statistics{
|
||||||
TotalConnections: s.service.Metrics().ConnectionCount,
|
TotalMessages: s.messageStore.MessagesCount(),
|
||||||
|
TotalConnections: s.service.Metrics().ConnectionCount,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return Statistics{}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *server) Delete(password string) error {
|
func (s *server) Delete(password string) error {
|
||||||
|
|
Loading…
Reference in New Issue