Skip to content

Commit

Permalink
feature: allow erb syntax in schedule file
Browse files Browse the repository at this point in the history
Review code for schedule config erb template
  • Loading branch information
edenisn committed Oct 3, 2016
1 parent d178ecf commit bc14ed7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/resque/integration/tasks/hooks.rake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# coding: utf-8
require 'erb'

namespace :resque do
# Здесь мы добавляем некоторые необходимые для корректной работы "хуки".
Expand Down Expand Up @@ -39,7 +40,8 @@ namespace :resque do
require 'resque-multi-job-forks' if ENV['JOBS_PER_FORK'] || ENV['MINUTES_PER_FORK']

if Resque.config.resque_scheduler? && Resque.config.schedule_exists?
Resque.schedule = YAML.load_file(Resque.config.schedule_file)
config = ERB.new(File.read(Resque.config.schedule_file)).result
Resque.schedule = YAML.load(config)
end

if Resque.config.run_at_exit_hooks? && ENV['RUN_AT_EXIT_HOOKS'].nil?
Expand Down

0 comments on commit bc14ed7

Please sign in to comment.