Modificação na ordem de carregamento do cache

pull/21/head
adriano 2023-01-01 22:25:34 -03:00
parent 522790901d
commit cdd07140a9
2 changed files with 4 additions and 2 deletions

View File

@ -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()

View File

@ -26,6 +26,8 @@ export const StartAllWhatsAppsSessions = async (): Promise<void> => {
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<void> => {
}
// await loadWhatsappCache()
await loadSchedulesCache()
createSessionDir()
delRestoreControllFile()