Backgroundrb Problem running twice?

V

Varun Goel

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
 
V

Varun Goel

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top