Question

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

Was it helpful?

Solution

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

RAILS_ENV=production ./script/workling_client start -t
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top