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