whenever icon indicating copy to clipboard operation
whenever copied to clipboard

Feature: Multiple scheduler files

Open cjba7 opened this issue 8 years ago • 4 comments

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.

cjba7 avatar Jun 13 '16 16:06 cjba7

I'm interested in this too. Our config/schedule.rb is over 500 lines long.

I tried the naive approach of requireing code from a separate file but it doesn't work.

andyw8 avatar Jan 12 '17 18:01 andyw8

I've found this workaround works for now: http://stackoverflow.com/a/16385259/119822

andyw8 avatar Jan 12 '17 18:01 andyw8

know this is an ongoing but we've used the option -i to solve this problem.

h55nick-ellevest avatar Feb 13 '17 19:02 h55nick-ellevest

@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?

fatkodima avatar Dec 19 '20 09:12 fatkodima