From 092bc10b2c585542bc2b110ee9477eecbded9853 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Wed, 26 Feb 2014 01:51:11 +0400 Subject: [PATCH] cleanup --- Rakefile | 6 ++++++ config/initializers/1_resque.rb | 8 +------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Rakefile b/Rakefile index 31c005551..bcaf13e41 100644 --- a/Rakefile +++ b/Rakefile @@ -8,6 +8,12 @@ require 'resque_scheduler/tasks' # This fixes connection fail with Postgres server on new fork: task "resque:setup" => :environment do + require 'resque' + require 'resque-scheduler' + Resque.after_fork do + Resque.redis.client.reconnect + Resque.schedule = YAML.load_file(File.join(Rails.root, 'config/resque_schedule.yml')) # load the schedule + end Resque.before_fork = Proc.new { ActiveRecord::Base.establish_connection } end diff --git a/config/initializers/1_resque.rb b/config/initializers/1_resque.rb index 07d6ca6fd..0c51c5ef6 100644 --- a/config/initializers/1_resque.rb +++ b/config/initializers/1_resque.rb @@ -10,12 +10,6 @@ Resque::Mailer.excluded_environments = [:test] unless Rails.env.test? PerformLater.config.enabled = true # this will default to false if unset - Resque.schedule = YAML.load_file(File.join(Rails.root, 'config/resque_schedule.yml')) # load the schedule end -Resque::Plugins::Status::Hash.expire_in = (24 * 60 * 60) # 24hrs in seconds - -Resque.before_fork = Proc.new { ActiveRecord::Base.establish_connection } -Resque.after_fork do - Resque.redis.client.reconnect -end \ No newline at end of file +Resque::Plugins::Status::Hash.expire_in = (24 * 60 * 60) # 24hrs in seconds \ No newline at end of file