fix(consumption): continue queue if client mailing fails
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Joan Sanchez 2023-04-18 10:08:04 +02:00
parent 6c71bda814
commit aabc4ec58d
1 changed files with 15 additions and 10 deletions

View File

@ -21,7 +21,7 @@ module.exports = Self => {
id,
params
FROM clientConsumptionQueue
WHERE status = ''`);
WHERE status = '' OR status IS NULL`);
for (const queue of queues) {
try {
@ -44,6 +44,7 @@ module.exports = Self => {
GROUP BY c.id`, [params.clients, params.from, params.to]);
for (const client of clients) {
try {
const args = {
id: client.clientFk,
recipient: client.clientEmail,
@ -54,6 +55,10 @@ module.exports = Self => {
const email = new Email('campaign-metrics', args);
await email.send();
} catch (error) {
if (error.code !== 'EENVELOPE')
throw error;
}
}
await Self.rawSql(`