fix for job queue inits all over to include configs

master
rob 2 years ago
parent 2e808015e5
commit 893a345e9f

@ -17,9 +17,7 @@ class EmailController extends SiteController {
async start ( ) {
const { jobQueue: jobQueueService, limiter: limiterService } = this.dtp.services;
this.emailJobQueue = jobQueueService.getJobQueue('email', {
attempts: 3
});
this.emailJobQueue = jobQueueService.getJobQueue('email', this.dtp.config.jobQueues.email);
const router = express.Router();
this.dtp.app.use('/email', router);

@ -29,7 +29,7 @@ class AttachmentService extends SiteService {
},
];
this.queue = this.getJobQueue('media');
this.queue = this.getJobQueue('media', this.dtp.config.jobQueues.media);
// this.template = this.loadViewTemplate('attachment/components/attachment-standalone.pug');
}

@ -31,7 +31,12 @@ class ChatService extends SiteService {
}
async start ( ) {
const { user: userService, limiter: limiterService } = this.dtp.services;
const {
jobQueue: jobQueueService,
user: userService,
limiter: limiterService,
} = this.dtp.services;
await super.start();
this.populateChatMessage = [
@ -122,7 +127,8 @@ class ChatService extends SiteService {
this.emitter = ioEmitter(this.dtp.redis);
this.queues = {
reeeper: await this.getJobQueue('reeeper'),
media: jobQueueService.getJobQueue('media', this.dtp.config.jobQueues.media),
reeeper: jobQueueService.getJobQueue('reeeper', this.dtp.config.jobQueues.reeeper),
};
}

@ -33,7 +33,7 @@ class StickerService extends SiteService {
},
];
this.queue = this.getJobQueue('media');
this.queue = this.getJobQueue('media', this.dtp.config.jobQueues.media);
this.stickerTemplate = this.loadViewTemplate('sticker/components/sticker-standalone.pug');
}

@ -28,7 +28,7 @@ class ChatRoomClearJob extends SiteWorkerProcess {
async start ( ) {
await super.start();
this.queue = await this.getJobQueue('chat');
this.queue = await this.getJobQueue('chat', this.dtp.config.jobQueues.chat);
this.log.info('registering job processor', { queue: this.queue.name, name: 'chat-room-clear' });
this.queue.process('chat-room-clear', this.processChatRoomClear.bind(this));

@ -37,7 +37,7 @@ class ChatRoomDeleteJob extends SiteWorkerProcess {
async start ( ) {
await super.start();
this.queue = await this.getJobQueue('chat');
this.queue = await this.getJobQueue('chat', this.dtp.config.jobQueues.chat);
this.log.info('registering job processor', { queue: this.queue.name, name: 'chat-room-delete' });
this.queue.process('chat-room-delete', this.processChatRoomDelete.bind(this));

@ -48,7 +48,7 @@ class MediaWorker extends SiteWorker {
const stickerId = mongoose.Types.ObjectId(process.argv[2]);
this.log.info('creating sticker processing job', { stickerId });
const queue = this.getJobQueue('media');
const queue = this.getJobQueue('media', this.dtp.config.jobQueues.media);
await queue.add('sticker-ingest', { stickerId });
}

@ -27,7 +27,7 @@ class AttachmentDeleteJob extends SiteWorkerProcess {
async start ( ) {
await super.start();
this.queue = await this.getJobQueue('media');
this.queue = await this.getJobQueue('media', this.dtp.config.jobQueues.media);
this.log.info('registering job processor', { queue: this.queue.name, name: 'attachment-delete' });
this.queue.process('attachment-delete', 1, this.processAttachmentDelete.bind(this));

@ -35,7 +35,7 @@ class AttachmentIngestJob extends SiteWorkerProcess {
async start ( ) {
await super.start();
this.queue = await this.getJobQueue('media');
this.queue = await this.getJobQueue('media', this.dtp.config.jobQueues.media);
this.log.info('registering job processor', { queue: this.queue.name, name: 'attachment-ingest' });
this.queue.process('attachment-ingest', 1, this.processAttachmentIngest.bind(this));

@ -27,7 +27,7 @@ class StickerDeleteJob extends SiteWorkerProcess {
async start ( ) {
await super.start();
this.queue = await this.getJobQueue('media');
this.queue = await this.getJobQueue('media', this.dtp.config.jobQueues.media);
this.log.info('registering job processor', { queue: this.queue.name, name: 'sticker-ingest' });
this.queue.process('sticker-delete', 1, this.processStickerDelete.bind(this));

@ -36,7 +36,7 @@ class StickerIngestJob extends SiteWorkerProcess {
async start ( ) {
await super.start();
this.queue = await this.getJobQueue('media');
this.queue = await this.getJobQueue('media', this.dtp.config.jobQueues.media);
this.log.info('registering job processor', { queue: this.queue.name, name: 'sticker-ingest' });
this.queue.process('sticker-ingest', 1, this.processStickerIngest.bind(this));

@ -24,7 +24,7 @@ class NewsletterEmailSendJob extends SiteWorkerProcess {
async start ( ) {
await super.start();
this.queue = await this.getJobQueue('newsletter');
this.queue = await this.getJobQueue('newsletter', this.dtp.config.jobQueues.newsletter);
this.log.info('registering job processor', { queue: this.queue.name, name: 'email-send' });
this.queue.process('email-send', this.processEmailSend.bind(this));

@ -29,7 +29,7 @@ class NewsletterTransmitJob extends SiteWorkerProcess {
async start ( ) {
await super.start();
this.queue = await this.getJobQueue('newsletter');
this.queue = await this.getJobQueue('newsletter', this.dtp.config.jobQueues.newsletter);
this.log.info('registering job processor', { queue: this.queue.name, name: 'transmit' });
this.queue.process('transmit', this.processTransmit.bind(this));

@ -19,7 +19,7 @@ class SampleService extends SiteService {
async start ( ) {
await super.start();
this.queue = this.getJobQueue('sample');
this.queue = this.getJobQueue('sample', this.dtp.config.jobQueues.sample);
}
async stop ( ) {

Loading…
Cancel
Save