Jun
10th
Tue
10th
Nice BackgroundRb.yml Config File
Here is a handy configuration to easily run BackgroundRb in both development and production environments without having to worry about multiple backgroundrb.yml files:
:backgroundrb:
:ip: 0.0.0.0
:port: 11111 # use port 11111
:production:
:backgroundrb:
:port: 22222 # use port 22222
:lazy_load: true # do not load models eagerly
:debug_log: false # disable log workers and other logging
:environment: production # use rails production environment
Then in development:
ruby script/backgroundrb start
and in production:
ruby script/backgroundrb start -e production
The backgroundrb environment variable loads all of the production variables from the config.yml file (including the rails environment), this isn’t obvious from the documentation and kind of confusing with the double environments. Hope this helps.