fix script

This commit is contained in:
Matt K. Fu 2013-08-27 18:37:09 +08:00
parent d8dd68b4df
commit 353039dcd0
1 changed files with 6 additions and 6 deletions

View File

@ -25,12 +25,11 @@ namespace :site do
task :necessary_data => :environment do task :necessary_data => :environment do
auto_setting auto_setting
site = Site.first site = Site.first
site.title = 'RulingOrbit Demo Site' site.update_attribute(:title,'RulingOrbit Demo Site')
site.resque_namespace = @resque_namespace site.update_attribute(:resque_namespace,@resque_namespace)
# home_trans = I18nVariable.create!( :document_class => 'Home', :key => 'home', :en => 'Homepage', :zh_tw => '首頁') # home_trans = I18nVariable.create!( :document_class => 'Home', :key => 'home', :en => 'Homepage', :zh_tw => '首頁')
design = Design.first design = Design.first
site = Site.first
site.design = design site.design = design
site.save site.save
theme = design.themes.first theme = design.themes.first
@ -51,6 +50,7 @@ namespace :site do
@resque_namespace = STDIN.gets.gsub("\n",'') @resque_namespace = STDIN.gets.gsub("\n",'')
@resque_namespace = APP_CONFIG['orbit'] if @resque_namespace.empty? @resque_namespace = APP_CONFIG['orbit'] if @resque_namespace.empty?
puts "Is this the only site [ Entry site? ] on this mechine?[Default No]:......" puts "Is this the only site [ Entry site? ] on this mechine?[Default No]:......"
site_is_alone = false site_is_alone = false
site_is_alone = STDIN.gets.gsub("\n",'') site_is_alone = STDIN.gets.gsub("\n",'')
@ -69,12 +69,12 @@ namespace :site do
@traffic_rate = traffic_heavy ? 2 : 1 @traffic_rate = traffic_heavy ? 2 : 1
if site_is_alone if site_is_alone
@resque_workers = 5 * traffic_rate #Entry Site @resque_workers = 5 * @traffic_rate #Entry Site
else else
if site_is_primary if site_is_primary
@resque_workers = 2 * traffic_rate #Primary Site @resque_workers = 2 * @traffic_rate #Primary Site
else else
@resque_workers = 1 * traffic_rate #Secondary Site @resque_workers = 1 * @traffic_rate #Secondary Site
end end
end end