[Backgroundrb-devel] [PATCH] allow different environments and move config into seperate class

Alex Peuchert rubyonrails-ug at peuchert.de
Thu Feb 21 04:00:41 EST 2008


Hi, I had the problem of running different BackgrounDRB processes with 
different environments on the same box. BackgrounDRB does not support 
that, so I added a little bit of code. I opened ticket #80 on devjavu 
with the patch attached.

* script/backgroundrb now supports cli parameters

    * -h for help
    * -e to choose an environment

* moved configuration handling into lib/bdrb_config.rb

    if there is an entry in backgroundrb.yml with the environment name
    that entry is merged back into the config, eg:

---
:development:
  :backgroundrb:
    :port: 11111
:production:
  :backgroundrb:
    :port: 11113

:backgroundrb:
  :ip: localhost
  :port: 11006

        if you run this under development port will be 11111, under
        production port will be 11113 (this is pretty cool, you can add
        config instructions depending on the environment, even schedules:)

* the PID files goes into tmp/pids/

* PID and LOG file names now include the port for differentiation

Hope this improves BackgrounDRB a little bit.
-alex



More information about the Backgroundrb-devel mailing list