Sha256: 320a2896a9e1d252a131f750c26b41124ae7360fc0c42fd8ab9e427a7d576490
Contents?: true
Size: 523 Bytes
Versions: 13
Compression:
Stored size: 523 Bytes
Contents
module CruLib module Async # This will be called by a worker when a job needs to be processed def perform(id, method, *args) if id begin self.class.find(id).send(method, *args) rescue ActiveRecord::RecordNotFound # If the record was deleted after the job was created, swallow it end else self.class.send(method, *args) end end def async(method, *args) Sidekiq::Client.enqueue(self.class, id, method, *args) end end end
Version data entries
13 entries across 13 versions & 1 rubygems