Sha256: 2344c1dcf6cf5e05fb51818cb8a4aa998cd7dc79b15f28f2bdcf57682c7e3247
Contents?: true
Size: 1011 Bytes
Versions: 8
Compression:
Stored size: 1011 Bytes
Contents
module BridgeCache::Jobs class ImportCheck < ActiveJob::Base queue_as :default include BridgeCache::Utils::WorkerHelper def perform(bridge_base_url, bridge_api_key, bridge_api_secret, models, chain = []) remote_data = BridgeBlueprint::RemoteData.new(bridge_base_url, bridge_api_key, bridge_api_secret) if remote_data.status == BridgeBlueprint::Constants::STATUS_COMPLETE BridgeCache::Jobs::ImportData.set(queue: self.queue_name).perform_later(bridge_base_url, bridge_api_key, bridge_api_secret, models, chain) elsif remote_data.status == BridgeBlueprint::Constants::STATUS_PENDING BridgeCache::Jobs::ImportCheck.set(queue: self.queue_name, wait: 30.seconds).perform_later(bridge_base_url, bridge_api_key, bridge_api_secret, models, chain) elsif remote_data.status == BridgeBlueprint::Constants::STATUS_FAILED || remote_data.status == BridgeBluePrint::Constants::STATUS_NOT_FOUND raise 'Bridge data dump download failed' end end end end
Version data entries
8 entries across 8 versions & 1 rubygems