chaynHQ / soulmedicine

Soul Medicine a multilingual digital service designed to deliver critical safety information and supportive messaging in bite-sized pieces.
https://soulmedicine.io
MIT License
34 stars 7 forks source link

Ensure the course for a Subscription is present as the last call before delivering the lesson #356

Closed tarebyte closed 10 months ago

tarebyte commented 11 months ago

We're currently attempting to reduce the amount of memory used on the worker Dyno in Heroku.

As a first step, I'd like to propose checking the existence of the Subscription's course as the last filter before delivering the lesson. This is the most expensive call, and currently we're checking every active subscription before ensuring we're supposed to be sending it in the current window.

I think the next step will be to break this process up into multiple smaller jobs to parallelize this work.