Sha256: 5df072e1e28288413c5b19fab81ca1ec668b878367053f3daf31c4056fc4a14f
Contents?: true
Size: 652 Bytes
Versions: 10
Compression:
Stored size: 652 Bytes
Contents
require 'sucker_punch' module DelayedCron module Jobs class SuckerPunch include ::SuckerPunch::Job def self.enqueue_delayed_cron(klass, method_name, options) unless scheduled?(klass) options.symbolize_keys! self.new.later(options[:interval], klass, method_name, options) end end def self.scheduled?(klass) ::SuckerPunch::Queue.new(klass).registered? end def perform(klass, method_name, options) DelayedCron.process_job(klass, method_name, options) end def later(sec, *args) after(sec) { perform(*args) } end end end end
Version data entries
10 entries across 10 versions & 1 rubygems