Sha256: 5233682d12044fb67b9030919285019a7aa073fb39f4b31106d0afed12aa10f1
Contents?: true
Size: 1.02 KB
Versions: 13
Compression:
Stored size: 1.02 KB
Contents
# frozen_string_literal: true require 'global_registry_bindings/entity/mdm_methods' module GlobalRegistry #:nodoc: module Bindings #:nodoc: module Workers #:nodoc: def self.mdm_worker_class(model_class) klass = Class.new(PullMdmIdWorker) do sidekiq_options unique: :until_timeout, unique_expiration: model_class.global_registry_entity.mdm_timeout end const_set model_class.global_registry_entity.mdm_worker_class_name, klass end class PullMdmIdWorker < ::GlobalRegistry::Bindings::Worker include GlobalRegistry::Bindings::Entity::MdmMethods def perform(model_class, id) super model_class, id pull_mdm_id_from_global_registry rescue ActiveRecord::RecordNotFound # If the record was deleted after the job was created, swallow it return rescue RestClient::ResourceNotFound Rails.logger.info "GR entity for #{self.class.name} #{id} does not exist; will _not_ retry" end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems