We would like to implement the following batch processing.
However, it is not a regular thing like once a day, but only when a request is made.
Therefore, on many days, batch processing may run five times a day, or on the contrary, it may not run once a day.
To achieve periodic batch processing in Rails
whenever seemed good.
However, as mentioned above, I was not sure what kind of design I should use to achieve irregular batch processing.
Also, I thought about how to register with cron every hour to check if there is a request or not, but I think it's not a very good design, so if there's any other good way, I'd like to design based on it.
Thank you for your cooperation.
以下 I would like to make it happen with the following image.
Also, I have a question for you.
Thank you for your understanding.
I would use ActiveJob.
As an image, this is what it looks like.
Since whenever is cron, I don't think it's suitable for irregular execution, but I wonder what it is like.
© 2022 OneMinuteCode. All rights reserved.