Skip to content

Commit

Permalink
feature: обновление resque, resque-scheduler
Browse files Browse the repository at this point in the history
https://jira.railsc.ru/browse/PC4-21241

resque-scheduler требует версию resque >= 1.26
  • Loading branch information
DmitryBochkarev committed Jan 23, 2018
1 parent a7173e5 commit 27b7b31
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dip.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '1'

environment:
DOCKER_RUBY_VERSION: 2.2
DOCKER_RUBY_VERSION: '2.2'
RUBY_IMAGE_TAG: 2.2-latest
COMPOSE_FILE_EXT: development
RAILS_ENV: test
Expand Down
8 changes: 8 additions & 0 deletions lib/resque/integration/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ class Engine < Rails::Engine
Resque.config = Resque::Integration::Configuration.new(*paths.map(&:to_s))
end

# Читает конфиг-файл config/resque_schedule.yml
initializer 'resque-integration.schedule_config' do
if Resque.config.resque_scheduler? && Resque.config.schedule_exists?
config = ERB.new(File.read(Resque.config.schedule_file)).result
Resque.schedule = YAML.load(config)
end
end

# Устанавливает для Resque соединение с Редисом,
# данные берутся из конфига (см. выше)
initializer 'resque-integration.redis' do
Expand Down
5 changes: 0 additions & 5 deletions lib/resque/integration/tasks/hooks.rake
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ namespace :resque do
# Support for resque-multi-job-forks
require 'resque-multi-job-forks' if ENV['JOBS_PER_FORK'] || ENV['MINUTES_PER_FORK']

if Resque.config.resque_scheduler? && Resque.config.schedule_exists?
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?
ENV['RUN_AT_EXIT_HOOKS'] = '1'
end
Expand Down
4 changes: 2 additions & 2 deletions resque-integration.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Gem::Specification.new do |gem|

gem.metadata['allowed_push_host'] = 'https://gems.railsc.ru'

gem.add_runtime_dependency 'resque', '= 1.25.2'
gem.add_runtime_dependency 'resque', '>= 1.25.2'
gem.add_runtime_dependency 'railties', '>= 3.0.0', '< 5'
gem.add_runtime_dependency 'activerecord', '>= 3.0.0', '< 5'
gem.add_runtime_dependency 'actionpack', '>= 3.0.0', '< 5'
Expand All @@ -26,7 +26,7 @@ Gem::Specification.new do |gem|
gem.add_runtime_dependency 'resque-progress', '~> 1.0.1'
gem.add_runtime_dependency 'resque-multi-job-forks', '~> 0.4.2'
gem.add_runtime_dependency 'resque-failed-job-mailer', '~> 0.0.3'
gem.add_runtime_dependency 'resque-scheduler', '~> 4.0', '< 4.2.1'
gem.add_runtime_dependency 'resque-scheduler', '~> 4.0'
gem.add_runtime_dependency 'resque-retry', '~> 1.5'
gem.add_runtime_dependency 'god', '~> 0.13.4'

Expand Down

0 comments on commit 27b7b31

Please sign in to comment.