Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
Backgroundrb Problem running twice?
Varun Goel
8/11/2008 7:37:00 AM
My experience through Backgroundrb is good it's working fine for me but
i got one issue in this pls help me out?I hope some problem in
scheduling the task?
my config
------------------------------
---
port: "3333"
timer_sleep: 60
load_rails: true
environment: development
rails_env: development
host: localhost
database_yml: config/database.yml
acl:
deny: all
allow: localhost 127.0.0.1
order: deny,allow
------------------------------
my worker
------------------------------
class PsWorker < BackgrounDRb::Rails
repeat_every 2.minutes
first_run Time.now
def do_work(args)
# This method is called in it's own new thread when you
# call new worker. args is set to :args
# logger.debug('DO_WORK '+args.inspect)
Sende1.deliver_test()
end
end
This is working fine in both windows and linux but it generate mail
twice after very two mins why?this is my problem pls give me your
suggestions.
Thanks
Varun
--
Posted via
http://www.ruby-...
.
1 Answer
Varun Goel
8/29/2008 10:06:00 AM
0
solution for this is:
@@running=false
def do_work(args)
if not @@running
@@running=true
<do whatever you need to do>
@@running=false
end
end
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Backgroundrb Problem running twice?
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password