makeitcount / saas-express-starter-kit

A boilerplate for any real world SaaS with features such as authentication, email service, etc.
MIT License
54 stars 10 forks source link

feat: job queue #54

Closed makeitcount closed 2 years ago

makeitcount commented 2 years ago
makeitcount commented 2 years ago

This PR fixes issue #6

makeitcount commented 2 years ago

This implementation uses bullmq for the heavylifting and Redis for queue data persistance.

How to add a new job definition i.e. what needs to be done

  1. Create a job definition (the task that needs to be performed) in WorkerJobs.js
  2. Map the job definition in WorkerService.JOB_PROCESSOR_MAP

How to add a new job to the queue i.e. when it needs to be done

A. For one time job WorkerService.addJob B. For a repetitive cron job WorkerService.addCronJob