Skip to content

Commit

Permalink
chore: handle errors in ReportSystemInfo methods
Browse files Browse the repository at this point in the history
  • Loading branch information
naiba committed Mar 3, 2025
1 parent 63208c1 commit ee63b3a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions service/rpc/nezha.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,16 @@ func (s *NezhaHandler) onReportSystemInfo(c context.Context, r *pb.Host) error {
}

func (s *NezhaHandler) ReportSystemInfo(c context.Context, r *pb.Host) (*pb.Receipt, error) {
s.onReportSystemInfo(c, r)
if err := s.onReportSystemInfo(c, r); err != nil {
return nil, err
}
return &pb.Receipt{Proced: true}, nil
}

func (s *NezhaHandler) ReportSystemInfo2(c context.Context, r *pb.Host) (*pb.Uint64Receipt, error) {
s.onReportSystemInfo(c, r)
if err := s.onReportSystemInfo(c, r); err != nil {
return nil, err
}
return &pb.Uint64Receipt{Data: singleton.DashboardBootTime}, nil
}

Expand Down

0 comments on commit ee63b3a

Please sign in to comment.