From cdd07140a98b3481c3ae9057079fb5fdd944f2ce Mon Sep 17 00:00:00 2001 From: adriano Date: Sun, 1 Jan 2023 22:25:34 -0300 Subject: [PATCH] =?UTF-8?q?Modifica=C3=A7=C3=A3o=20na=20ordem=20de=20carre?= =?UTF-8?q?gamento=20do=20cache?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/helpers/SchedulingNotifyCache.ts | 2 +- .../src/services/WbotServices/StartAllWhatsAppsSessions.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/src/helpers/SchedulingNotifyCache.ts b/backend/src/helpers/SchedulingNotifyCache.ts index baacb5c..ef13826 100644 --- a/backend/src/helpers/SchedulingNotifyCache.ts +++ b/backend/src/helpers/SchedulingNotifyCache.ts @@ -111,7 +111,7 @@ async function searchScheduleCache(date: string, hour: number | string, minute: date = escapeCharCache(date).trim() - const response: any = await redis.call('FT.SEARCH', 'idx_schedule', `(@date_escaped:${date}) (@hour:${hour}) (@minute:${minute})`) + const response: any = await redis.call('FT.SEARCH', 'idx_schedule', `(@date_escaped:${date}) (@hour:${hour}) (@minute:${minute})`) await redis.quit() diff --git a/backend/src/services/WbotServices/StartAllWhatsAppsSessions.ts b/backend/src/services/WbotServices/StartAllWhatsAppsSessions.ts index 444c373..212c435 100644 --- a/backend/src/services/WbotServices/StartAllWhatsAppsSessions.ts +++ b/backend/src/services/WbotServices/StartAllWhatsAppsSessions.ts @@ -26,6 +26,8 @@ export const StartAllWhatsAppsSessions = async (): Promise => { console.log('cacheSize: ', cacheLength) + await loadSchedulesCache() + if (cacheLength == 0) { console.log('Loading from cache...') await flushCache() @@ -34,7 +36,7 @@ export const StartAllWhatsAppsSessions = async (): Promise => { } // await loadWhatsappCache() - await loadSchedulesCache() + createSessionDir() delRestoreControllFile()