On Fri, Feb 22, 2008 at 9:53 AM, Todd Tyree <[EMAIL PROTECTED]> wrote:
>
> The problem I'm having is that ask_status always returns 'Running', even if
> the worker is dead and gone, so I can never get it to restart this way.
> I've confirmed the worker is dead via top, ps and the xmpp admin console.
The master worker keeps the status for workers even after they are
dead, because in most cases it is useful to be able to query a
worker's status once it has died.
This is a little clumsy, but you can write your method like this instead:
def worker_alive?
!(MiddleMan.all_worker_info.detect{|worker| worker[:status] ==
:running && worker[:worker] == :xmpp_worker }.nil?)
end
As far as I can see all_worker_info only returns currently running
workers, so probably the check for :status == :running is redundant.
Ryan
_______________________________________________
Backgroundrb-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/backgroundrb-devel