Skip to content

Commit 00849dc

Browse files
committed
log waraning when cannot send heartbeat check to phone
1 parent 2a72663 commit 00849dc

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

api/pkg/handlers/phone_handler.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,6 @@ func (h *PhoneHandler) Upsert(c *fiber.Ctx) error {
116116
return h.responseBadRequest(c, err)
117117
}
118118

119-
ctxLogger.Info(string(c.Body()))
120-
121-
ctxLogger.Info(spew.Sdump(request))
122-
123119
if errors := h.validator.ValidateUpsert(ctx, request.Sanitize()); len(errors) != 0 {
124120
msg := fmt.Sprintf("validation errors [%s], while updating phones [%+#v]", spew.Sdump(errors), request)
125121
ctxLogger.Warn(stacktrace.NewError(msg))

api/pkg/services/phone_notification_service.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,9 @@ func (service *PhoneNotificationService) SendHeartbeatFCM(ctx context.Context, p
7373
Token: *phone.FcmToken,
7474
})
7575
if err != nil {
76-
msg := fmt.Sprintf("cannot send heartbeat FCM to phone with id [%s]", phone.ID)
77-
return service.tracer.WrapErrorSpan(span, stacktrace.Propagate(err, msg))
76+
msg := fmt.Sprintf("cannot send heartbeat FCM to phone with id [%s] for user [%s]", phone.ID, phone.UserID)
77+
ctxLogger.Warn(stacktrace.Propagate(err, msg))
78+
return nil
7879
}
7980

8081
ctxLogger.Info(fmt.Sprintf("successfully sent heartbeat FCM [%s] to phone with ID [%s] for user [%s] and monitor [%s]", result, payload.PhoneID, payload.UserID, payload.MonitorID))

0 commit comments

Comments
 (0)