Here is the code of ruote.rb in rails app config/initializers/ :
require 'rubygems'
require 'json' # gem install json
require 'ruote'
require 'ruote-sequel' # gem install ruote-sequel
require 'commonx'
require 'logger'
require 'daemons'
#Usage:
# bundle exec ruby ruote_worker.rb sqlite://../biz-tools/db/development.sqlite3
#Default value
# set up ruote storage
db_name = 'sqlite://../biz-tools/db/development.sqlite3'
db_name = ARGV[0] if ARGV[0]
db_name = Commonx::CommonxHelper.find_ruote_config_for('db_name')
#sequel = Sequel.connect('sqlite://../biz-tools/db/development.sqlite3')
sequel = Sequel.connect('sqlite://db/' + db_name)
#ruote_docs is hte table name
opts = { 'sequel_table_name' => 'ruote_docs' }
RUOTE_STORAGE = Ruote::Sequel::Storage.new(sequel, opts)
RUOTE.register do
eval(Commonx::CommonxHelper.find_ruote_config_for('ruote_participant_register'))
catchall
end
# let's join the worker thread (prevents the script from exiting)
RUOTE.join
logger = Logger.new('ruote_worker.log')
# set up ruote dashboard and run ruote worker outside of rails app
worker = Ruote::Worker.new("worker", RUOTE_STORAGE)
logger.info("Starting ruote worker...")
worker.run_in_thread()
logger.info("Started ruote worker...")
On Thursday, December 12, 2013 9:03:42 PM UTC-6, emc_lab wrote:
>
> Hi All,
> We have the current setting in window7: Ruote worker is started within
> rails on its own thread, all is good. We moved our deployment to a linux
> box and we are using nginx and passenger to host our rails app. We
> configured passenge to keep at least 1 instance of a rails app, and
> therefore not killing the apps and the ruote worker. What we have noticed
> after some inactivity about 15 minutes, the Ruote.storage_participant.all
> will retunr no workitems, if I bounce nginx, the sames call will return the
> workitems. We thought may the passenger config is wrong, but double check
> (see below) but we also record the ruby pid, prior to the incativty period
> and after and the ruby pid is the same. Any way you can help us figuring
> out the issue?.
>
> snippet of the nginx config:
>
> #biz-tools
> location ~ ^/bt/*$ {
> return 301 /bt/authentify/signin;
> passenger_min_instances 1;
> }
>
>
--
--
you received this message because you are subscribed to the "ruote users" group.
to post : send email to [email protected]
to unsubscribe : send email to [email protected]
more options : http://groups.google.com/group/openwferu-users?hl=en
---
You received this message because you are subscribed to the Google Groups
"ruote" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.