views:

1038

answers:

2

Hi All,

I have a rails app that has asynchronous processing, and I'm having trouble getting it to work in production mode. i start starling from the root of the application like so:

starling -d -P tmp/pids/starling.pid -q log/

then i start workling like this

./script/workling_client start -t

the first time i ran this, it complained because there was no development database, so i created a development database, and that error went away when i restarted workling. but when i try to actually run an asynchronous process, i get this message in log/production.log

Workling::QueueserverNotFoundError (config/workling.yml configured to connect to queue server on localhost:15151 for this environment. could not connect to queue server on this host:port. for starling users: pass starling the port with -p flag when starting it.

so, i run

sudo killall starling

then restart starling from the root of the application like this:

starling -d -P tmp/pids/starling.pid -q log/ -p 15151

which seems to work fine, but then when i try to start workling again with this script/workling_client start -t, i get this message in the console

/var/rails-apps/daisi/vendor/plugins/workling/lib/workling/clients/memcache_queue_client.rb:68:in `raise_unless_connected!': config/workling.yml configured to connect to queue server on localhost:22122 for this environment. could not connect to queue server on this host:port. for starling users: pass starling the port with -p flag when starting it. If you don't want to use Starling, then explicitly set Workling::Remote.dispatcher (see README for an example) (Workling::QueueserverNotFoundError)

So, I tried changing the config/workling.yml file inside the workling plugin to make both production and development listen on 15151, that didn't work, then i tried both of them on 22122, still no dice, so i tried a random port, but it still gives the exact same behaviour no matter what I put in the workling.yml file

Plz Halp!

Thx

-C

+3  A: 

the answer is that starling has to be started as such:

RAILS_ENV=production ./script/workling_client start -t
Chris Drappier
A: 

It still doesnt work for me on production. development works like a charm. starling does queue the messages under var/spool/starling. but workling doesnt pick it up. i dont get any errors when i run workling_client run on top. so it is able to connect to the starling instance. (i say so since when i start workling without starling, i get the above kind of errors). what could i be doing wrong?

my workling yml file is also simple - development: listens_on: localhost:22122 sleep_time: 2 reset_time: 30 listeners: Util: sleep_time: 20 memcache_options: namespace: mem-development

production: listens_on: localhost:22122 sleep_time: 2 reset_time: 30 listeners: Util: sleep_time: 20 memcache_options: namespace: mem-production

vinod