chore: handle errors in ReportSystemInfo methods

This commit is contained in:
naiba
2025-03-03 22:56:48 +08:00
parent 63208c1d35
commit ee63b3a808

View File

@@ -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
}