switchman-inst-jobs 1.3.7 → 1.4.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
  SHA256:
3
- metadata.gz: 2bab0c63ffbb0a328830881dd3a7c4d87dcf4d257924540e3f817987cc0b02ca
4
- data.tar.gz: 4efc1a1f73cd1c4e3343ebabb4aee21ce8b974b7191052616d6e1266e1547875
3
+ metadata.gz: e356c85ca33caeb996923b7f3e4c94da8b248926f87d5377ff045940a7095528
4
+ data.tar.gz: 2ea9d61311e2c647e312db5ac784057fe3daa2d7a5c18223e5566a6cab99feb9
5
5
  SHA512:
6
- metadata.gz: 79109e3f82d473756cdb953c78b5e062c6f5bd4f262356c86c4502abe5aebff40a45679dea2ec530552d23b104fd70ab3f75f7686587d0da75c28ff97bc963fe
7
- data.tar.gz: 39dda681ada80591021c3ca33df1061ae62307d94870fd6e4f5193cc361a4353a4b74f7ac86e0a4ab8bfd1fa4f4e800ac7556bbc6d4572b3ea314b5f4b551bf9
6
+ metadata.gz: 36533c7c02872720de54a09dd48e4e54aaa806600320699bccacd0fe67fac9c000020eddb5604b3ed371ad0d8565ec3afd9fad9273524ba3935cc0d7b8e14312
7
+ data.tar.gz: adbc33542dd9ea39d628370e8580dca9d957fe002da78e8b35746aaa871b74610c2bff6681d955afa5c756650fcfd0130416011264f3811e545b26b8e87e07a0
@@ -64,12 +64,14 @@ module SwitchmanInstJobs
64
64
 
65
65
  def deserialize(source)
66
66
  raise ShardNotFoundError, shard_id unless current_shard
67
+
67
68
  current_shard.activate { super }
68
69
  rescue ::Switchman::ConnectionError, PG::ConnectionBad, PG::UndefinedTable
69
70
  # likely a missing shard with a stale cache
70
71
  current_shard.send(:clear_cache)
71
72
  ::Switchman::Shard.clear_cache
72
73
  raise ShardNotFoundError, shard_id unless ::Switchman::Shard.where(id: shard_id).exists?
74
+
73
75
  raise
74
76
  end
75
77
  end
@@ -3,6 +3,7 @@ module SwitchmanInstJobs
3
3
  module MessageSending
4
4
  def send_later_enqueue_args(method, _enqueue_args = {}, *args)
5
5
  return send(method, *args) if ::Switchman::DatabaseServer.creating_new_shard
6
+
6
7
  super
7
8
  end
8
9
  end
@@ -20,15 +20,20 @@ module SwitchmanInstJobs
20
20
 
21
21
  def reschedule_abandoned_jobs(call_super: false)
22
22
  shards = ::Switchman::Shard.delayed_jobs_shards
23
- call_super = true if shards.length == 1
24
- return munge_service_name(::Switchman::Shard.current(:delayed_jobs)) { super() } if call_super
23
+ call_super = shards.first if shards.length == 1
24
+ unless call_super == false
25
+ call_super.activate(:delayed_jobs) do
26
+ return munge_service_name(call_super) { super() }
27
+ end
28
+ end
25
29
 
26
30
  ::Switchman::Shard.with_each_shard(shards, [:delayed_jobs], exception: :ignore) do
31
+ shard = ::Switchman::Shard.current(:delayed_jobs)
27
32
  singleton = <<~SINGLETON
28
- periodic: Delayed::Worker::HealthCheck.reschedule_abandoned_jobs:#{::Switchman::Shard.current(:delayed_jobs).id}
33
+ periodic: Delayed::Worker::HealthCheck.reschedule_abandoned_jobs:#{shard.id}
29
34
  SINGLETON
30
35
  send_later_enqueue_args(
31
- :reschedule_abandoned_jobs, { singleton: singleton }, call_super: true
36
+ :reschedule_abandoned_jobs, { singleton: singleton }, call_super: shard
32
37
  )
33
38
  end
34
39
  end
@@ -3,6 +3,7 @@ module SwitchmanInstJobs
3
3
  module DatabaseServer
4
4
  def delayed_jobs_shard(shard = nil)
5
5
  return shard if config[:delayed_jobs_shard] == 'self'
6
+
6
7
  dj_shard =
7
8
  config[:delayed_jobs_shard] &&
8
9
  ::Switchman::Shard.lookup(config[:delayed_jobs_shard])
@@ -76,6 +76,7 @@ module SwitchmanInstJobs
76
76
 
77
77
  db_dj_shards = ::Switchman::DatabaseServer.all.map do |db|
78
78
  next db.shards.to_a if db.config[:delayed_jobs_shard] == 'self'
79
+
79
80
  db.delayed_jobs_shard
80
81
  end.compact.flatten.uniq # yes, all three
81
82
 
@@ -1,3 +1,3 @@
1
1
  module SwitchmanInstJobs
2
- VERSION = '1.3.7'.freeze
2
+ VERSION = '1.4.1'.freeze
3
3
  end
@@ -5,7 +5,7 @@ module SwitchmanInstJobs
5
5
  if object.tag == '!ruby/ActiveRecord:Switchman::Shard'
6
6
  ::Switchman::Shard.lookup(object.value) ||
7
7
  raise(Delayed::Backend::RecordNotFound,
8
- "Couldn't find Switchman::Shard with id #{object.value.inspect}")
8
+ "Couldn't find Switchman::Shard with id #{object.value.inspect}")
9
9
  else
10
10
  super
11
11
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: switchman-inst-jobs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.7
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryan Petty
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-21 00:00:00.000000000 Z
11
+ date: 2020-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: inst-jobs
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.12.1
19
+ version: '0.15'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: '0.16'
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 0.12.1
29
+ version: '0.15'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '0.16'
@@ -36,7 +36,7 @@ dependencies:
36
36
  requirements:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
- version: '4.2'
39
+ version: '5.2'
40
40
  - - "<"
41
41
  - !ruby/object:Gem::Version
42
42
  version: '6.1'
@@ -46,7 +46,7 @@ dependencies:
46
46
  requirements:
47
47
  - - ">="
48
48
  - !ruby/object:Gem::Version
49
- version: '4.2'
49
+ version: '5.2'
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
52
  version: '6.1'
@@ -56,7 +56,7 @@ dependencies:
56
56
  requirements:
57
57
  - - ">="
58
58
  - !ruby/object:Gem::Version
59
- version: 1.9.7
59
+ version: '1.14'
60
60
  - - "<"
61
61
  - !ruby/object:Gem::Version
62
62
  version: '1.15'
@@ -66,7 +66,7 @@ dependencies:
66
66
  requirements:
67
67
  - - ">="
68
68
  - !ruby/object:Gem::Version
69
- version: 1.9.7
69
+ version: '1.14'
70
70
  - - "<"
71
71
  - !ruby/object:Gem::Version
72
72
  version: '1.15'
@@ -132,14 +132,14 @@ dependencies:
132
132
  requirements:
133
133
  - - "~>"
134
134
  - !ruby/object:Gem::Version
135
- version: '0'
135
+ version: '1.0'
136
136
  type: :development
137
137
  prerelease: false
138
138
  version_requirements: !ruby/object:Gem::Requirement
139
139
  requirements:
140
140
  - - "~>"
141
141
  - !ruby/object:Gem::Version
142
- version: '0'
142
+ version: '1.0'
143
143
  - !ruby/object:Gem::Dependency
144
144
  name: pry
145
145
  requirement: !ruby/object:Gem::Requirement
@@ -160,14 +160,14 @@ dependencies:
160
160
  requirements:
161
161
  - - "~>"
162
162
  - !ruby/object:Gem::Version
163
- version: '12.0'
163
+ version: '12'
164
164
  type: :development
165
165
  prerelease: false
166
166
  version_requirements: !ruby/object:Gem::Requirement
167
167
  requirements:
168
168
  - - "~>"
169
169
  - !ruby/object:Gem::Version
170
- version: '12.0'
170
+ version: '12'
171
171
  - !ruby/object:Gem::Dependency
172
172
  name: rspec
173
173
  requirement: !ruby/object:Gem::Requirement
@@ -202,42 +202,56 @@ dependencies:
202
202
  requirements:
203
203
  - - "~>"
204
204
  - !ruby/object:Gem::Version
205
- version: 0.57.2
205
+ version: 0.79.0
206
+ type: :development
207
+ prerelease: false
208
+ version_requirements: !ruby/object:Gem::Requirement
209
+ requirements:
210
+ - - "~>"
211
+ - !ruby/object:Gem::Version
212
+ version: 0.79.0
213
+ - !ruby/object:Gem::Dependency
214
+ name: rubocop-rails
215
+ requirement: !ruby/object:Gem::Requirement
216
+ requirements:
217
+ - - "~>"
218
+ - !ruby/object:Gem::Version
219
+ version: 2.4.2
206
220
  type: :development
207
221
  prerelease: false
208
222
  version_requirements: !ruby/object:Gem::Requirement
209
223
  requirements:
210
224
  - - "~>"
211
225
  - !ruby/object:Gem::Version
212
- version: 0.57.2
226
+ version: 2.4.2
213
227
  - !ruby/object:Gem::Dependency
214
228
  name: simplecov
215
229
  requirement: !ruby/object:Gem::Requirement
216
230
  requirements:
217
231
  - - "~>"
218
232
  - !ruby/object:Gem::Version
219
- version: '0.14'
233
+ version: '0.18'
220
234
  type: :development
221
235
  prerelease: false
222
236
  version_requirements: !ruby/object:Gem::Requirement
223
237
  requirements:
224
238
  - - "~>"
225
239
  - !ruby/object:Gem::Version
226
- version: '0.14'
240
+ version: '0.18'
227
241
  - !ruby/object:Gem::Dependency
228
242
  name: wwtd
229
243
  requirement: !ruby/object:Gem::Requirement
230
244
  requirements:
231
245
  - - "~>"
232
246
  - !ruby/object:Gem::Version
233
- version: 1.3.0
247
+ version: '1.4'
234
248
  type: :development
235
249
  prerelease: false
236
250
  version_requirements: !ruby/object:Gem::Requirement
237
251
  requirements:
238
252
  - - "~>"
239
253
  - !ruby/object:Gem::Version
240
- version: 1.3.0
254
+ version: '1.4'
241
255
  description:
242
256
  email:
243
257
  - bpetty@instructure.com
@@ -276,7 +290,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
276
290
  requirements:
277
291
  - - ">="
278
292
  - !ruby/object:Gem::Version
279
- version: '2.3'
293
+ version: '2.4'
280
294
  required_rubygems_version: !ruby/object:Gem::Requirement
281
295
  requirements:
282
296
  - - ">="