Sha256: 16192fb3a1717d24781998096edb1d54d8722f5d0dcbbfb96ce5bd05f0674206
Contents?: true
Size: 1.05 KB
Versions: 4
Compression:
Stored size: 1.05 KB
Contents
module Sidejobs module Extensions module ActiveJob module QueueAdapters class SidejobsAdapter class << self def enqueue(job) Sidejobs.queue.add( job.serialize, queue: job.queue_name, priority: calculate_priority(job.queue_name) ) end def enqueue_at(job, timestamp) Sidejobs.queue.add( job.serialize, queue: job.queue_name, priority: calculate_priority(job.queue_name), schedule_at: Time.at(timestamp) ) end private def calculate_priority(queue) case queue when 'mailers' 80 when 'high_priority' 60 when 'default' 40 when 'low_priority' 20 else 0 end end end end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems