From 10d15930da4fb022a2f9f3502b588614f8e33c1a Mon Sep 17 00:00:00 2001 From: adriano Date: Sun, 1 Jan 2023 22:53:01 -0300 Subject: [PATCH] =?UTF-8?q?Modifica=C3=A7=C3=A3o=20ordem=20cache=20schedul?= =?UTF-8?q?ing=20notify?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WbotServices/StartAllWhatsAppsSessions.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/backend/src/services/WbotServices/StartAllWhatsAppsSessions.ts b/backend/src/services/WbotServices/StartAllWhatsAppsSessions.ts index 212c435..8a57695 100644 --- a/backend/src/services/WbotServices/StartAllWhatsAppsSessions.ts +++ b/backend/src/services/WbotServices/StartAllWhatsAppsSessions.ts @@ -8,7 +8,7 @@ import Whatsapp from "../../models/Whatsapp"; import ListWhatsAppsService from "../WhatsappService/ListWhatsAppsService"; import { StartWhatsAppSession } from "./StartWhatsAppSession"; const fs = require('fs') - + import "../../helpers/SchedulingNotifySendMessage" import "../../helpers/WhoIsOnlineMonitor" @@ -20,13 +20,13 @@ import { createSessionDir } from "../../helpers/CreateSessionDir"; let counter = 0 -export const StartAllWhatsAppsSessions = async (): Promise => { +export const StartAllWhatsAppsSessions = async (): Promise => { const cacheLength = await cacheSize() console.log('cacheSize: ', cacheLength) - await loadSchedulesCache() + if (cacheLength == 0) { console.log('Loading from cache...') @@ -34,9 +34,10 @@ export const StartAllWhatsAppsSessions = async (): Promise => { await loadContactsCache() await loadTicketsCache() } - + + await loadSchedulesCache() // await loadWhatsappCache() - + createSessionDir() delRestoreControllFile() @@ -107,6 +108,6 @@ export const StartAllWhatsAppsSessions = async (): Promise => { }); } - + };