perf: Reuse redis connections where possible (#1157)

* reuse redis connections where possible

* redis -> ioredis
This commit is contained in:
Tom Moor
2020-01-13 18:17:41 -08:00
committed by GitHub
parent f231c664e6
commit 5b78cb8963
8 changed files with 41 additions and 19 deletions

View File

@@ -4,7 +4,7 @@ import debug from 'debug';
import bugsnag from 'bugsnag';
import nodemailer from 'nodemailer';
import Oy from 'oy-vey';
import Queue from 'bull';
import { createQueue } from './utils/queue';
import { baseStyles } from './emails/components/EmailLayout';
import { WelcomeEmail, welcomeEmailText } from './emails/WelcomeEmail';
import { ExportEmail, exportEmailText } from './emails/ExportEmail';
@@ -182,7 +182,7 @@ export class Mailer {
const mailer = new Mailer();
export default mailer;
export const mailerQueue = new Queue('email', process.env.REDIS_URL);
export const mailerQueue = createQueue('email');
mailerQueue.process(async (job: EmailJob) => {
// $FlowIssue flow doesn't like dynamic values