zuora_connect 1.7.54 → 1.7.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1d077b3fe3e33f3f0fd383e8e54b25ff1712f950
4
- data.tar.gz: ed6a49af88ffbec02f897993d1244cc4a7c91f3f
3
+ metadata.gz: e8cd456de5a165de07a5881d2f9193a07ef90556
4
+ data.tar.gz: e16915afc0bb6e2d56f20ee305ffa5746b894356
5
5
  SHA512:
6
- metadata.gz: 9fe85df39cd2734b73eb42598eabdab43799b5a6d2f5a0afd2154ac7dff61172ba607e0adc620e6b96bef29d13152620f2c61a545b35c5d29b3c54c1c0fe45d5
7
- data.tar.gz: 044501330ed1a4a703ca0da443ed0c5aaa313a31fef1067251e6ffb1add683504cf8b77cea808620010ff5294bc996aa951f47be38f5c86295de0aeac08a1ba8
6
+ metadata.gz: 142408e633010bf5379a3e0aceebb627c7e643dc861600708e0362f23e1cd2f8d3803d97145e063b9a163d8a9f25d4342304e89a6e8bca0a0e045bf6815f913d
7
+ data.tar.gz: 26e613fa91eca022a0002bb9e6922411158bf31680be9397e4225632be85436a654ba8ec76552bc05d8dec7ad748a4bae9c83da67d639a954b6d6b116ed227b4
@@ -59,7 +59,10 @@ module Resque
59
59
  #Instance queue grouping
60
60
  if !grouped_queues.keys.include?(nil) && grouped_queues.keys.size > 0
61
61
  if ZuoraConnect.configuration.blpop_queue
62
- return get_job(grouped_queues)
62
+ @job_in_progress = get_queued_job(grouped_queues)
63
+ return @job_in_progress if @job_in_progress.present?
64
+
65
+ return @job_in_progress = get_restricted_job
63
66
  else
64
67
  @n ||= 0
65
68
  @n += 1
@@ -93,11 +96,6 @@ module Resque
93
96
  Resque::Job.new(queue, payload)
94
97
  end
95
98
 
96
- def get_job(grouped_queues)
97
- get_restricted_job
98
- get_queued_job(grouped_queues)
99
- end
100
-
101
99
  def get_next_job(grouped_queues)
102
100
  @n ||= 1
103
101
  queue_index = {}
@@ -119,27 +117,31 @@ module Resque
119
117
  end
120
118
 
121
119
  def get_queued_job(grouped_queues)
122
- # Bounded retry
123
- 1.upto(Resque::Plugins::ConcurrentRestriction.reserve_queued_job_attempts) do |i|
124
- resque_job = get_next_job(grouped_queues)
120
+ if defined?(Resque::Plugins::ConcurrentRestriction)
121
+ # Bounded retry
122
+ 1.upto(Resque::Plugins::ConcurrentRestriction.reserve_queued_job_attempts) do |i|
123
+ resque_job = get_next_job(grouped_queues)
125
124
 
126
- # Short-curcuit if a job was not found
127
- return if resque_job.nil?
125
+ # Short-curcuit if a job was not found
126
+ return if resque_job.nil?
128
127
 
129
- # If there is a job on regular queues, then only run it if its not restricted
130
- job_class = resque_job.payload_class
131
- job_args = resque_job.args
128
+ # If there is a job on regular queues, then only run it if its not restricted
129
+ job_class = resque_job.payload_class
130
+ job_args = resque_job.args
132
131
 
133
- # Return to work on job if not a restricted job
134
- return resque_job unless job_class.is_a?(Resque::Plugins::ConcurrentRestriction)
132
+ # Return to work on job if not a restricted job
133
+ return resque_job unless job_class.is_a?(Resque::Plugins::ConcurrentRestriction)
135
134
 
136
- # Keep trying if job is restricted. If job is runnable, we keep the lock until
137
- # done_working
138
- return resque_job unless job_class.stash_if_restricted(resque_job)
135
+ # Keep trying if job is restricted. If job is runnable, we keep the lock until
136
+ # done_working
137
+ return resque_job unless job_class.stash_if_restricted(resque_job)
138
+ end
139
+
140
+ # Safety net, here in case we hit the upper bound and there are still queued items
141
+ return nil
142
+ else
143
+ return get_next_job(grouped_queues)
139
144
  end
140
-
141
- # Safety net, here in case we hit the upper bound and there are still queued items
142
- return nil
143
145
  end
144
146
 
145
147
  # Returns a list of queues to use when searching for a job.
@@ -1,3 +1,3 @@
1
1
  module ZuoraConnect
2
- VERSION = "1.7.54"
2
+ VERSION = "1.7.55"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zuora_connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.54
4
+ version: 1.7.55
5
5
  platform: ruby
6
6
  authors:
7
7
  - Connect Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-26 00:00:00.000000000 Z
11
+ date: 2019-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: apartment