Browse Source

fix(email-plugin): Correctly register failed email sending, add retry

Michael Bromley 4 years ago
parent
commit
f50708a965

+ 1 - 1
packages/email-plugin/src/email-processor.ts

@@ -87,7 +87,7 @@ export class EmailProcessor {
             } else {
                 Logger.error(String(err), loggerCtx);
             }
-            return false;
+            throw err;
         }
     }
 }

+ 1 - 1
packages/email-plugin/src/plugin.ts

@@ -247,7 +247,7 @@ export class EmailPlugin implements OnApplicationBootstrap, NestModule {
                 return;
             }
             if (this.jobQueue) {
-                await this.jobQueue.add(result);
+                await this.jobQueue.add(result, { retries: 5 });
             } else if (this.testingProcessor) {
                 await this.testingProcessor.process(result);
             }