mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-16 07:16:38 +00:00
Always initialize status recorder (#383)
Always initialize the status recorder Utilize proto methods to get pbFullStatus values.
This commit is contained in:
@@ -95,7 +95,9 @@ func (s *Server) Start() error {
|
||||
|
||||
s.config = config
|
||||
|
||||
s.statusRecorder = nbStatus.NewRecorder()
|
||||
if s.statusRecorder == nil {
|
||||
s.statusRecorder = nbStatus.NewRecorder()
|
||||
}
|
||||
|
||||
go func() {
|
||||
if err := internal.RunClient(ctx, config, s.statusRecorder); err != nil {
|
||||
@@ -400,6 +402,10 @@ func (s *Server) Status(
|
||||
|
||||
statusResponse := proto.StatusResponse{Status: string(status)}
|
||||
|
||||
if s.statusRecorder == nil {
|
||||
s.statusRecorder = nbStatus.NewRecorder()
|
||||
}
|
||||
|
||||
if msg.GetFullPeerStatus {
|
||||
fullStatus := s.statusRecorder.GetFullStatus()
|
||||
pbFullStatus := toProtoFullStatus(fullStatus)
|
||||
|
||||
Reference in New Issue
Block a user