build(operator): remove console.log
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2024-06-03 14:37:24 +02:00
parent 35ae728e81
commit 9775e808a2
1 changed files with 0 additions and 7 deletions

View File

@ -17,25 +17,18 @@ module.exports = Self => {
const {backupPrinterNotificationDelay} = await models.ProductionConfig.findOne(); const {backupPrinterNotificationDelay} = await models.ProductionConfig.findOne();
if (backupPrinterNotificationDelay) { if (backupPrinterNotificationDelay) {
console.log('operator delay:',
backupPrinterNotificationDelay,
Date.vnNow(),
new Date(Date.vnNow() - (backupPrinterNotificationDelay * 1000))
);
const notifications = await models.NotificationQueue.find( const notifications = await models.NotificationQueue.find(
{where: {created: {gte: new Date(Date.vnNow() - (backupPrinterNotificationDelay * 1000))}, {where: {created: {gte: new Date(Date.vnNow() - (backupPrinterNotificationDelay * 1000))},
notificationFk: notificationName, notificationFk: notificationName,
status: 'sent' status: 'sent'
} }
}); });
console.log('notifications: ', notifications);
const criteria = {labelerId: labelerFk, sectorId: sectorFk}; const criteria = {labelerId: labelerFk, sectorId: sectorFk};
const filteredNotifications = notifications.filter(notification => { const filteredNotifications = notifications.filter(notification => {
const paramsObj = JSON.parse(notification.params); const paramsObj = JSON.parse(notification.params);
return Object.keys(criteria).every(key => criteria[key] === paramsObj?.[key]); return Object.keys(criteria).every(key => criteria[key] === paramsObj?.[key]);
}); });
console.log('filteredNotifications: ', filteredNotifications);
if (filteredNotifications.length >= 1) return; if (filteredNotifications.length >= 1) return;
} }