def work(interval = 5.0)
      interval = Float(interval)
      $0 = "resque-delayed: harvesting"
      startup

      loop do
        break if shutdown?

        # harvest delayed jobs while they are available
        while job = Resque::Delayed.next do
          log "got: #{job.inspect}"
          queue, klass, *args = job
          Resque::Job.create(queue, klass, *args)
        end

        break if interval.zero?
        log! "Sleeping for #{interval} seconds"
        sleep interval
      end
    end
def work(interval = 5.0)
      interval = Float(interval)
      $0 = "resque-delayed: harvesting"
      startup

      loop do
        break if shutdown?

        # harvest delayed jobs while they are available
        while job = Resque::Delayed.next do
          log "got: #{job.inspect}"
          queue, klass, *args = job
          Resque::Job.create(queue, klass, *args)
        end

        break if interval.zero?
        log! "Sleeping for #{interval} seconds"
        sleep interval
      end
    end
Can be passed a float representing the polling frequency.
 The default is 5 seconds, but for a semi-active site you may
 want to use a smaller value.