My Rails 5 application should rely upon the execution of tasks at a 
specific time: a task every Monday at 8:00 am (except in December), a task 
any time the 1st of January, a task before 10 am the 1st of December and a 
task every 1st of each month of the year.
All these tasks should be executed only once.

At first I thought the Heroku Scheduler app could be the right choice, but 
in my opinion this is not suitable to my needs and might be not a good 
idea. The Heroku Scheduler looks quite too simplistic a solution because it 
can be used only for daily, hourly or every 10 minutes tasks, and Heroku 
warns that "Scheduler is a “best effort” service, meaning that execution is 
expected but not guaranteed. Scheduler is known to occasionally (but 
rarely) miss the execution of scheduled jobs."

I already written my tasks using conditionals such as:

if Time.now.monday? && !(Time.now.month == 12) && (Time.now.hour == 8)

But I would not be so sure the Heroku Scheduler would execute it.
Heroku advises that "if scheduled jobs are a critical component of your 
application, *it is recommended to* run a custom clock process 
<https://devcenter.heroku.com/articles/scheduled-jobs-custom-clock-processes> 
instead for more reliability, control, and visibility."

Custom clock processes are poorly described at Heroku, but it seems clear 
that "custom clock implementations vary greatly by language".
So, as far as Rails is concerned, I first bumped into JohnDel's answer at 
Stackoverflow 
<http://stackoverflow.com/questions/38981620/automatically-delete-all-records-after-30-days>,
 
then I discovered that I might use Active Job plus a 3rd-party queuing 
library as a queuing backend.

The page Active Job Basics 
<http://guides.rubyonrails.org/active_job_basics.html> at railsguides are 
to my understanding quite too basic. For instance there are not useful 
examples for method 'perform' in chapter 3.1, it is not clear where method 
'perfom_later' in chapter 3.2 comes from. what other specific queues there 
are apart from 'low_priority'...

What solution would you suggest?
If you too think that Active Job is the rails way to do the job, I would 
greatly appreciate if you could suggest me, a total newbie to this topic, 
useful and comprehensive documentation for Active Job and for the queuing 
libraries and queue backends you consider the most suitable and appropriate.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/6af21610-1c22-4034-a754-b8df099363e9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to