fix(consumption): continue queue if client mailing fails
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
6c71bda814
commit
aabc4ec58d
|
@ -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(`
|
||||
|
|
Loading…
Reference in New Issue