From e10eb833edd3930c4a38d7a2b712ad1c26417c17 Mon Sep 17 00:00:00 2001 From: "Matt K. Fu" Date: Wed, 19 Jun 2013 15:43:02 +0800 Subject: [PATCH 1/2] fix rescue scheduler space error --- config/resque_schedule.god | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/resque_schedule.god b/config/resque_schedule.god index 696a2fd0e..cfe5487ab 100644 --- a/config/resque_schedule.god +++ b/config/resque_schedule.god @@ -10,7 +10,7 @@ development_gid = '' w.group = 'resque' w.interval = 30.seconds w.env = {"QUEUE"=>"critical,high,low", "RAILS_ENV"=>rails_env} - w.start = "HOME= #{user_home} QUEUE=* RAILS_ENV=#{rails_env} rake -f #{rails_root}/Rakefile resque:scheduler" + w.start = "HOME=#{user_home} QUEUE=* RAILS_ENV=#{rails_env} rake -f #{rails_root}/Rakefile resque:scheduler" w.uid = (rails_env == 'production' )? "root" : development_uid w.gid = (rails_env == 'production' )? "root" : development_gid From d78e816b4e7dd3e45b77e7c6406daeee059aa399 Mon Sep 17 00:00:00 2001 From: "Matt K. Fu" Date: Wed, 19 Jun 2013 15:45:53 +0800 Subject: [PATCH 2/2] from now on the rescue namespace will be decided by site object field: resque_namespace --- app/models/site.rb | 2 +- config/initializers/resque.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/site.rb b/app/models/site.rb index 07facaa79..486803e55 100644 --- a/app/models/site.rb +++ b/app/models/site.rb @@ -28,7 +28,7 @@ class Site mount_uploader :default_image, ImageUploader field :search,:type => Hash - + field :resque_namespace,:type => String, :default=>APP_CONFIG['orbit'] field :title, localize: true field :footer, localize: true field :sub_menu, localize: true diff --git a/config/initializers/resque.rb b/config/initializers/resque.rb index bd7a91fe5..f16c6fa4f 100644 --- a/config/initializers/resque.rb +++ b/config/initializers/resque.rb @@ -3,7 +3,7 @@ require 'resque_scheduler/server' # require 'yaml' Resque.redis = 'localhost:6379' -Resque.redis.namespace = "resque" +Resque.redis.namespace = Site.first.resque_namespace rescue APP_CONFIG['orbit'] # If you want to be able to dynamically change the schedule, # uncomment this line. A dynamic schedule can be updated via the