DeleteMonitor an entities.HeartbeatMonitor
(ctx context.Context, userID entities.UserID, owner string)
| 246 | |
| 247 | // DeleteMonitor an entities.HeartbeatMonitor |
| 248 | func (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 |
| 264 | func (service *HeartbeatService) UpdatePhoneOnline(ctx context.Context, userID entities.UserID, monitorID uuid.UUID, phoneOnline bool) error { |
no test coverage detected