From 16075f3d2eaeb8354262f618420ebc4f1578d77b Mon Sep 17 00:00:00 2001 From: Moe Date: Fri, 19 Aug 2022 23:17:44 -0700 Subject: [PATCH] Make cron.js ignore archived data --- libs/cron/worker.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libs/cron/worker.js b/libs/cron/worker.js index 683dce70..04467f58 100644 --- a/libs/cron/worker.js +++ b/libs/cron/worker.js @@ -203,6 +203,7 @@ function beginProcessing(){ const groupKey = v.ke; const whereQuery = [ ['ke','=',v.ke], + ['archive','!=',`1`], ['time','<', sqlDate(days+' DAY')], addedQueries ] @@ -261,6 +262,7 @@ function beginProcessing(){ table: "Monitors", where: [ ['ke','=',v.ke], + ['archive','!=',`1`], ] }) const monitorRows = monitorsResponse.rows @@ -384,6 +386,7 @@ function beginProcessing(){ const groupKey = v.ke; const whereQuery = [ ['ke','=',v.ke], + ['archive','!=',`1`], ['time','<', sqlDate(daysOldForDeletion+' DAY')], ] const selectResponse = await knexQueryPromise({ @@ -455,6 +458,7 @@ function beginProcessing(){ table: "Events", where: [ ['ke','=',v.ke], + ['archive','!=',`1`], ['time','<', sqlDate(daysOldForDeletion + ' DAY')], ] },(err,rrr) => { @@ -505,6 +509,7 @@ function beginProcessing(){ table: "Files", where: [ ['ke','=',v.ke], + ['archive','!=',`1`], ['time','<', sqlDate(daysOldForDeletion + ' DAY')], ] },(err,files) => {