Change schedules

This commit is contained in:
Douglas Barone 2021-12-21 15:15:07 -04:00
parent ceb68afe04
commit b2c09663f8

View File

@ -2,14 +2,14 @@ import cron from 'node-cron'
import oui from 'oui'
import { User } from './classes/User'
import { deleteOldLogs, log, logInfo, logSuccess } from './lib/logger'
import { deleteOldLogs, logInfo, logSuccess } from './lib/logger'
logInfo({
tags: ['cron'],
message: 'Agendando tarefas...'
})
cron.schedule('0 0 0 * * *', async () => {
cron.schedule('0 0 4 * * *', async () => {
logInfo({
tags: ['cron', 'user'],
message: `Importação dos usuários do AD iniciada.`
@ -23,7 +23,7 @@ cron.schedule('0 0 0 * * *', async () => {
})
})
cron.schedule('0 0 0 * * *', async () => {
cron.schedule('0 0 3 * * *', async () => {
await oui.update()
logSuccess({
tags: ['cron', 'oui'],
@ -31,7 +31,7 @@ cron.schedule('0 0 0 * * *', async () => {
})
})
cron.schedule('0 0 0 * * *', async () => {
cron.schedule('0 0 2 * * *', async () => {
await deleteOldLogs()
logSuccess({
tags: ['cron', 'log'],