Sha256: c92cdbd17790e1d07ec57daaade81eeb77db3d1b890e3caf1fa9802c945af7f2

Contents?: true

Size: 564 Bytes

Versions: 5

Compression:

Stored size: 564 Bytes

Contents

module Qujo
  module Queue
    module Resque
      class ScheduleWorker
        @queue = :default
        @job = nil

        class << self
          def perform(options={})
            c = job.constantize
            j = c.create!
            j.enqueue
          rescue => e
            logger.error e.message
            logger.error e
          end

          def job
            raise "job #{@job.inspect} not found" unless @job
            @job
          end

          def logger
            Qujo.logger
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
qujo-0.1.4 lib/qujo/queue/resque/schedule_worker.rb
qujo-0.1.3 lib/qujo/queue/resque/schedule_worker.rb
qujo-0.1.2 lib/qujo/queue/resque/schedule_worker.rb
qujo-0.1.1 lib/qujo/queue/resque/schedule_worker.rb
qujo-0.1.0 lib/qujo/queue/resque/schedule_worker.rb