Sha256: 946ee1a3e84f4aeeace644b0b8d73c6671cef89bd49f53189ceeb45dd25aceb6

Contents?: true

Size: 530 Bytes

Versions: 3

Compression:

Stored size: 530 Bytes

Contents

module QPush
  module Server
    module Apis
      class Setup < Base
        def call
          invalid_job && return unless @job.valid?
          setup_job
        end

        private

        def setup_job
          Perform.call(@job) if @job.perform_job?
          Delay.call(@job, :delay) if @job.delay_job?
        end

        def invalid_job
          Server.log.err("Worker #{Server.worker.id} | Job INVALID | #{@job.klass} | #{@job.id} | #{@job.errors.full_messages.join(' ')}")
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
qpush-0.1.8 lib/qpush/server/apis/setup.rb
qpush-0.1.7 lib/qpush/server/apis/setup.rb
qpush-0.1.6 lib/qpush/server/apis/setup.rb