On Tuesday, November 3, 2015 at 6:58:05 AM UTC+1, Greg Navis wrote:
>
> I work on a Rails app and have 3 entry point jobs: every_day, every_hour,
> every_10_minutes. There are scheduler entries that run rake every_day, rake
> every_hour and rake every_10_minutes with appropriate frequencies. Specific
> jobs are defined as dependencies of these entry points. This allows me to
> change the schedule by editing the code without touching the scheduler at
> all.
>
thanks a lot for that great solution.
class EveryJob < ApplicationJob
queue_as :default
def perform(time)
if time == 10.minutes
# do something
else
raise "#{time} is not supported"
end
end
end
and then in heroku scheduler:
rails runner "EveryJob.perform_later(10.minutes)"
works great
--
--
You received this message because you are subscribed to the Google
Groups "Heroku" group.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/heroku?hl=en_US?hl=en
---
You received this message because you are subscribed to the Google Groups
"Heroku Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.