Codificação de trycatch para timers do schedulerNotify e monitor do online offline ale de configuração da tabela do online offline

pull/1/head
adriano 2022-05-17 21:36:55 -03:00
parent 8924e2a8e0
commit 70245a9904
4 changed files with 8 additions and 4 deletions

View File

@ -29,8 +29,10 @@ const monitor = async () => {
try { try {
const { schedulingNotifies, count, hasMore } = await ListSchedulingNotifyService({ searchParam: dateParm, pageNumber: "1" }); const { schedulingNotifies, count, hasMore } = await ListSchedulingNotifyService({ searchParam: dateParm, pageNumber: "1" });
if(schedulingNotifies.length){ // console.log('schedulingNotifies: ',schedulingNotifies)
if(schedulingNotifies && schedulingNotifies.length>0){
const ticket = await ShowTicketService(schedulingNotifies[0].ticketId); const ticket = await ShowTicketService(schedulingNotifies[0].ticketId);

View File

@ -9,6 +9,8 @@ import { addHours, addMinutes, addSeconds, intervalToDuration, add } from "date-
onlineTime.setUTCMinutes(new Date(oldOnlineTimeSum.onlineTime).getMinutes()) onlineTime.setUTCMinutes(new Date(oldOnlineTimeSum.onlineTime).getMinutes())
onlineTime.setUTCSeconds(new Date(oldOnlineTimeSum.onlineTime).getSeconds()) onlineTime.setUTCSeconds(new Date(oldOnlineTimeSum.onlineTime).getSeconds())
// console.log('_________________oldOnlineTimeSum.updatedAt: ', oldOnlineTimeSum.updatedAt)
let newtTime = intervalToDuration({ start: new Date(oldOnlineTimeSum.updatedAt), end: new Date() }) let newtTime = intervalToDuration({ start: new Date(oldOnlineTimeSum.updatedAt), end: new Date() })

View File

@ -34,7 +34,7 @@ let deleted: boolean = false;
const emitterOnline = (user: any, status: string, showOnlineTime: boolean = true) => { const emitterOnline = (user: any, status: string, showOnlineTime: boolean = true) => {
if (!user.id) return if (!user.id || !user.updatedAt || !user.onlineTime) return
let newOnlinetime = sumOnlineTimeNow(user) let newOnlinetime = sumOnlineTimeNow(user)

View File

@ -705,7 +705,7 @@ const Report = () => {
[ [
// { title: 'Foto', field: 'ticket.contact.profilePicUrl', render: rowData => <img src={rowData['ticket.contact.profilePicUrl']} alt="imagem de perfil do whatsapp" style={{ width: 40, borderRadius: '50%' }} /> }, // { title: 'Foto', field: 'ticket.contact.profilePicUrl', render: rowData => <img src={rowData['ticket.contact.profilePicUrl']} alt="imagem de perfil do whatsapp" style={{ width: 40, borderRadius: '50%' }} /> },
{ title: 'Nome', field: 'name' }, { title: 'Nome', field: 'name', cellStyle: {whiteSpace: 'nowrap'}, },
{ {
title: 'Status', field: 'statusOnline.status', title: 'Status', field: 'statusOnline.status',