[Backgroundrb-devel] Tasks get executed twice with repeat_every

Martin May martin at nosleepmedia.com
Mon Aug 28 21:21:05 EDT 2006


I have a simple worker that I set up with repeat_every:

class DueNoteQueuerWorker < BackgrounDRb::Rails

   repeat_every 1.minutes
   first_run Time.now

   def do_work(args)
     @logger.debug("Sending due notes. The current time is #{Time.now}")
   end

end


I want this to run every minute, all the time. The first run is fine,  
but it seems that subsequent runs get executed twice. From the logfile:

# Logfile created on Mon Aug 28 19:18:01 MDT 2006 by logger.rb/1.5.2.7
Sending due notes. The current time is Mon Aug 28 19:18:03 MDT 2006
Sending due notes. The current time is Mon Aug 28 19:19:03 MDT 2006
Sending due notes. The current time is Mon Aug 28 19:19:03 MDT 2006
Sending due notes. The current time is Mon Aug 28 19:20:03 MDT 2006
Sending due notes. The current time is Mon Aug 28 19:20:03 MDT 2006

Is there any way to fix that? Here is my configuration file:

---
port: "22222"
timer_sleep: 60
load_rails: true
environment: development
host: localhost
database_yml: config/database.yml
acl:
   deny: all
   allow: localhost 127.0.0.1
   order: deny,allow
autostart:
   1:
     job_key: due_note_queuer1
     class: due_note_queuer_worker

Thanks,
Martin







More information about the Backgroundrb-devel mailing list