whenever
whenever copied to clipboard
Feature: Multiple scheduler files
As title states, ability to use multiple scheduler files. Perhaps look for a schedule folder and load everything in it as schedule tasks?
p.s. I have tried looking for some time on SO and in the Issues here if it is supported but to no avail - apologies if it does.
I'm interested in this too. Our config/schedule.rb
is over 500 lines long.
I tried the naive approach of require
ing code from a separate file but it doesn't work.
I've found this workaround works for now: http://stackoverflow.com/a/16385259/119822
know this is an ongoing but we've used the option -i
to solve this problem.
@cba7 @andyw8 @benlangfeld
So is this still an issue with the proposed workaround?
Similar techniques are also used when splitting large Gemfile
or routes.rb
with no problems.
We can implement something like
# config/schedule.rb
# ...
# Load reporting schedules
import "config/schedule/reporting_schedule"
# or just (assuming some default dir to read from)
import "reporting_schedule"
but this is not much simpler than
# config/schedule.rb
# ...
# Load reporting schedules
instance_eval(File.read('reporting_schedule.rb'), 'reporting_schedule.rb')
Maybe just a note to README would be enough?