public async Task <IActionResult> DetenerOperacionAsync() { try { await _backgroundTask.StopAsync(); Log.Information(Constantes.Operacion.DETENCIONOPERACION); _response = Ok(Constantes.Operacion.DETENCIONOPERACION); } catch (Exception ex) { Log.Error(ex, Constantes.MsgLog.ERRORMETODO, nameof(DetenerOperacionAsync)); _response = StatusCode(HttpStatusCode.InternalServerError.GetHashCode(), string.Format(Constantes.Tarea.FALLOTAREA, ex.Message, ex.StackTrace)); } return(_response); }