MCPcopy Index your code
hub / github.com/NdoleStudio/httpsms / DeleteMonitor

Method DeleteMonitor

api/pkg/services/heartbeat_service.go:248–261  ·  view source on GitHub ↗

DeleteMonitor an entities.HeartbeatMonitor

(ctx context.Context, userID entities.UserID, owner string)

Source from the content-addressed store, hash-verified

246
247// DeleteMonitor an entities.HeartbeatMonitor
248func (service *HeartbeatService) DeleteMonitor(ctx context.Context, userID entities.UserID, owner string) error {
249 ctx, span := service.tracer.Start(ctx)
250 defer span.End()
251
252 ctxLogger := service.tracer.CtxLogger(service.logger, span)
253
254 if err := service.monitorRepository.Delete(ctx, userID, owner); err != nil {
255 msg := fmt.Sprintf("cannot delete heartbeat monitor with userID [%s] and owner [%s]", userID, owner)
256 return service.tracer.WrapErrorSpan(span, stacktrace.Propagate(err, msg))
257 }
258
259 ctxLogger.Info(fmt.Sprintf("heartbeat monitor deleted for userID [%s] and owner [%s]", userID, owner))
260 return nil
261}
262
263// UpdatePhoneOnline updates the phone_online field in an entities.HeartbeatMonitor
264func (service *HeartbeatService) UpdatePhoneOnline(ctx context.Context, userID entities.UserID, monitorID uuid.UUID, phoneOnline bool) error {

Callers 1

onPhoneDeletedMethod · 0.80

Calls 5

StartMethod · 0.65
CtxLoggerMethod · 0.65
DeleteMethod · 0.65
WrapErrorSpanMethod · 0.65
InfoMethod · 0.65

Tested by

no test coverage detected