Changeset 271

Show
Ignore:
Timestamp:
12/13/07 07:48:15 (8 months ago)
Author:
gethema..@gmail.com
Message:

check in new README file:

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/README

    r268 r271  
    4040   |   :ip: 0.0.0.0 
    4141   |   :port: 11006 
     42   |   :environment: production 
    4243   | 
    4344   | :schedules: 
     
    5051 
    5152Above sample configuration file would schedule worker methods 'foobar' and 'barbar' 
    52 to be executed at different trigger periods. 
     53to be executed at different trigger periods. Also, it would load production rails environment. 
     54If you skit the :environment option, development env will be loaded. 
    5355 
    5456NOTE: Please note that, because of addition of this feature, format of backgroundrb.yml 
     
    237239  care, so as for one worker, they are never the same. 
    238240 
     241* Starting and stopping from CLI : 
     242  To start: 
     243      ./script/backgroundrb start 
     244  Top stop: 
     245      ./script/backgroundrb stop 
     246 
     247 
    239248* Query Status/Result of a worker : 
    240249 
  • trunk/server/meta_worker.rb

    r270 r271  
    191191      ActiveRecord::Base.allow_concurrency = true 
    192192      db_config_file = YAML.load(ERB.new(IO.read("#{RAILS_HOME}/config/database.yml")).result) 
    193       run_env = @config_file[:backgroundrb][:environment] 
     193      run_env = @config_file[:backgroundrb][:environment] || 'development' 
    194194      require RAILS_HOME + '/config/environment.rb' 
    195195      ENV['RAILS_ENV'] = run_env