Rainbows! Rack HTTP server user/dev discussion
 help / color / mirror / code / Atom feed
From: Alexandre Riveira <alexandre-VwDbj2YsoUp0ZRtCdD4y8VAUjnlXr6A1@public.gmane.org>
To: Eric Wong <normalperson-rMlxZR9MS24@public.gmane.org>
Cc: Rainbows! list <rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org>
Subject: Re: background threads
Date: Mon, 18 Jun 2012 19:08:16 +0000	[thread overview]
Message-ID: <4FDF7CA0.6030103@objectdata.com.br> (raw)
In-Reply-To: <20120618215550.GA31162-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>

Em 18-06-2012 21:55, Eric Wong escreveu:

What kind of problems?

The application consumes 100% cpu after reload

Is preload_app true or false?  (default is false)
preload_app is true

I changed  my code  as below  and got  a result in  small servers
  Thread.new(log) do |rotina_log|
     loop do
        log.info("rotina automatica") {"waiting process before end"}
        break unless File.exists? Dir.pwd + '/tmp/pids/rainbows.pid.oldbin'

     loop do
       #rotina_log.info("rotina automatica") { "waiting 60 secs #{Process.pid}" }
       if $0.include? "old"
         rotina_log.info("rotina automatica") { "exit..... #{Process.pid}" }
         #rotina_log.info("rotina automatica") { "exec #{Process.pid}" }
         empresas = Empresa::Base.find_all_by_cancelado(false)
         empresas.invoke(:rotinas_automaticas, :usuario_id =>  Auth::Configuracao.instance.usuario_sistema_id)
         #rotina_log.info("rotina automatica") { "exec ok #{Process.pid}" }
       rescue Exception =>  e
         rotina_log.fatal("rotina automatica") { e.to_s + e.backtrace.inspect }


Alexandre Riveira

Rainbows! mailing list - rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org
Do not quote signatures (like this one) or top post when replying

  parent reply	other threads:[~2012-06-18 22:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-18 18:32 background threads Alexandre Riveira
     [not found] ` <4FDF7420.7030300-VwDbj2YsoUp0ZRtCdD4y8VAUjnlXr6A1@public.gmane.org>
2012-06-18 21:55   ` Eric Wong
     [not found]     ` <20120618215550.GA31162-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>
2012-06-18 19:08       ` Alexandre Riveira [this message]
     [not found]         ` <4FDF7CA0.6030103-VwDbj2YsoUp0ZRtCdD4y8VAUjnlXr6A1@public.gmane.org>
2012-06-18 22:21           ` Eric Wong
2012-06-18 19:26       ` Alexandre Riveira
     [not found]     ` <4FDF81A5.6080605@objectdata.com.br>
     [not found]       ` <4FDF81A5.6080605-VwDbj2YsoUp0ZRtCdD4y8VAUjnlXr6A1@public.gmane.org>
2012-06-18 22:42         ` Eric Wong
     [not found]           ` <4FDF85C2.1030900@objectdata.com.br>
     [not found]             ` <4FDF85C2.1030900-VwDbj2YsoUp0ZRtCdD4y8VAUjnlXr6A1@public.gmane.org>
2012-06-18 22:53               ` Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://yhbt.net/rainbows/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FDF7CA0.6030103@objectdata.com.br \
    --to=alexandre-vwdbj2ysoup0zrtcdd4y8vaujnlxr6a1@public.gmane.org \
    --cc=normalperson-rMlxZR9MS24@public.gmane.org \
    --cc=rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).