bridge_cache 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bcbcf635958dffd3ce2bf3434966ac404855cefd
4
- data.tar.gz: d939dd4a949d0c9b48da19d5485337e8389d026a
3
+ metadata.gz: fb980e159b42a27d015675b0283220804ae28b49
4
+ data.tar.gz: cfd141b554926cd16897136c99eb548f2b256bb5
5
5
  SHA512:
6
- metadata.gz: 5955932e3fdc3eb63da5001c8b137d8bb3d6f1ec53a75994bc6f3d3946db4e6bfeca44ccb73d261df7f15ad94130c36f0c1b0579745808650fd1766e8ce08ff3
7
- data.tar.gz: d094e6bac904d755590c98df015fd2ae4a16e9bb24f5a03fb0b4dde598183bbd069d729bd3162a2365abca17381a390dc16e268b210d0a7a53e107fd5714e002
6
+ metadata.gz: 42ff929b01e2d7baa5876285ed0ed79cb4963e2b213241673a34c325ee34b5c5f7af2b5ef4ad70938748aaddf4f967b4745035791c91f37923df3823544b2684
7
+ data.tar.gz: fc44ffbe1445c928a48abf491439ede2f889fe999d95ba0c597e6b46c8fe0e2009638b49812a83ab5b1a832825be51e8e3ed9d8f40399dd420270ab6481d1f1e
@@ -5,14 +5,14 @@ module BridgeCache::Jobs
5
5
 
6
6
  ATTEMPTS_THRESHOLD = 30
7
7
 
8
- def perform(bridge_base_url, bridge_api_key, bridge_api_secret, models, attempts, chain = [])
8
+ def perform(bridge_base_url, bridge_api_key, bridge_api_secret, models, attempts, chain = [], global_options = {})
9
9
  remote_data = BridgeBlueprint::RemoteData.new(bridge_base_url, bridge_api_key, bridge_api_secret)
10
10
  if attempts > ATTEMPTS_THRESHOLD
11
11
  Rails.logger.fatal("Bridge data dump failed to download after #{(ATTEMPTS_THRESHOLD * 30) / 60} minutes")
12
12
  elsif remote_data.status == BridgeBlueprint::Constants::STATUS_COMPLETE
13
- BridgeCache::Jobs::ImportData.set(queue: self.queue_name).perform_later(bridge_base_url, bridge_api_key, bridge_api_secret, models, chain)
13
+ BridgeCache::Jobs::ImportData.set(queue: self.queue_name).perform_later(bridge_base_url, bridge_api_key, bridge_api_secret, models, chain, global_options)
14
14
  elsif remote_data.status == BridgeBlueprint::Constants::STATUS_PENDING
15
- BridgeCache::Jobs::ImportCheck.set(queue: self.queue_name, wait: 30.seconds).perform_later(bridge_base_url, bridge_api_key, bridge_api_secret, models, attempts + 1, chain)
15
+ BridgeCache::Jobs::ImportCheck.set(queue: self.queue_name, wait: 30.seconds).perform_later(bridge_base_url, bridge_api_key, bridge_api_secret, models, attempts + 1, chain, global_options)
16
16
  elsif remote_data.status == BridgeBlueprint::Constants::STATUS_FAILED || remote_data.status == BridgeBlueprint::Constants::STATUS_NOT_FOUND
17
17
  raise 'Bridge data dump download failed'
18
18
  end
@@ -3,7 +3,7 @@ module BridgeCache::Jobs
3
3
  include BridgeCache::Utils::WorkerHelper
4
4
  queue_as :default
5
5
 
6
- def perform(bridge_base_url, bridge_api_key, bridge_api_secret, models, chain = [])
6
+ def perform(bridge_base_url, bridge_api_key, bridge_api_secret, models, chain = [], global_options = {})
7
7
  begin
8
8
  remote_data = BridgeBlueprint::RemoteData.new(bridge_base_url, bridge_api_key, bridge_api_secret)
9
9
  Dir.mktmpdir do |dir|
@@ -2,10 +2,10 @@ module BridgeCache::Jobs
2
2
  class ImportStart < ActiveJob::Base
3
3
  queue_as :default
4
4
 
5
- def perform(bridge_base_url, bridge_api_key, bridge_api_secret, models, chain = [])
5
+ def perform(bridge_base_url, bridge_api_key, bridge_api_secret, models, chain = [], global_options = {})
6
6
  begin
7
7
  data = BridgeBlueprint::RemoteData.new(bridge_base_url, bridge_api_key, bridge_api_secret)
8
- models = (['domain', 'affiliated_sub_account'] + models).uniq
8
+ models = (['domain', 'affiliated_sub_account'] + models).uniq unless global_options[:subaccount]
9
9
  data.start_data_report
10
10
  BridgeCache::Jobs::ImportCheck
11
11
  .set(queue: self.queue_name, wait: 30.seconds)
@@ -15,7 +15,8 @@ module BridgeCache::Jobs
15
15
  bridge_api_secret,
16
16
  models,
17
17
  0,
18
- chain
18
+ chain,
19
+ global_options
19
20
  )
20
21
  rescue => e
21
22
  Rails.logger.debug(e)
@@ -1,3 +1,3 @@
1
1
  module BridgeCache
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bridge_cache
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - jshaffer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-15 00:00:00.000000000 Z
11
+ date: 2018-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -274,7 +274,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
274
274
  version: '0'
275
275
  requirements: []
276
276
  rubyforge_project:
277
- rubygems_version: 2.6.14
277
+ rubygems_version: 2.2.2
278
278
  signing_key:
279
279
  specification_version: 4
280
280
  summary: A mountable engine for bridge data storage