Closed hortongn closed 6 years ago
@scherztc @hortongn
So, I'm assuming we currently have two separate cron jobs for notification and release.
Can I propose a slight refactor to the rake tasks so that the :release task is called from the :notification task? Then we could consolidate cron jobs and be assured that both actions are happening in concert.
Yes, we currently have two cron job that run the separate release and notify rake tasks.
I personally am indifferent as to whether we call separate tasks for each or if one calls the other. So I say go with what you think makes the most sense. You could also leave the two rake tasks alone and just create a third "release_and_notify" task that calls the other two rake tasks.
I think if I were going to have one task call another, I would have the release run before the notify. That way if something goes wrong with the release and the rake task ends prematurely, it will happen before emails go out to users. Not likely to happen, but possible.
Descriptive summary
The recently implemented embargo release rake task works fine, but it must run just before midnight to release the next day's embargoes. The notify task, however, is designed to run on the day the embargo expires. So by the time the notify task runs, the embargo has already been released and Scholar thinks no notifications need to be sent.
Adjust the notify rake task so that it sends out the notification 1 day prior instead of exactly on the embargo date.