This week I got to work with workers/queues without prior experience. I had to fill gaps in my understanding, and implement functionality simultaneously, so this week was less productive in terms of coding and more in terms of learning.
One of the main reasons I struggled working with BullMQ API was that the concepts seemed too abstract. It took me a while to understand the relationship between Queues and Workers and how to leverage them to run background tasks to check whether we have to send email reminders to users or not.
I added a background job to Starchart to repeat every 5 minutes and check whether any domains or certificates in the database expire in less than a month. We send out notifications if we find such an entry in the database. We are also keeping track of the number of times we have notified the user, as we only want to send up to two reminders. The first reminder will be sent out one month in advance, and the second reminder will only be sent out close to the expiration date.
At the moment, I want to send the first reminder without any problems or side effects. If that goes well, I will work on sending another reminder close to the expiration date.
I want to get comfortable working with BullMQ workers and queues, as the api can be leveraged in many projects requiring background job processing to solve real-world problems without burdening the application.
Top comments (0)