switchman-inst-jobs 2.0.0 → 3.0.0

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: 9f1525c9c7e0f08abefab65094c1479bed9c042585b627022ef5f3d97f05a798
4
- data.tar.gz: d47f434d7869d9898e04222b232230c5b54b6c9c11dc390b387438d169dcec67
3
+ metadata.gz: 7d0284b8288ca18b825002cb7df51b1f4f6469f3f62202d997934a42507f91f4
4
+ data.tar.gz: 7a4c11dca853c6d5aad2731f5aa9bc0e0af19cb2be149f9c22e57ebc6fd6e4b9
5
5
  SHA512:
6
- metadata.gz: 13ea49df7bfd9c7430c6d6261d11510697ce2c91e62e175cb94d12bc03eb0f6174b5153e35ddf1fe8357a5d20e389b13046aae42d9658016f3ecf7174691c45c
7
- data.tar.gz: 7c4ab126b6527b164aa5f278dda90755f15a39d9bc0c2d94cbbabac3d7c3f7c493fcef5009f7d35f4d836c756538d563e00ed3cc96657a7e356ee860c726c7f3
6
+ metadata.gz: e9a126073f7a1904eadf82f265f8c052c9fd5291b05760099f5bbc12dfd8714f4c8f8b2636a9c534568897cac676430b7741b1c36685d5d7c2291568795f9c80
7
+ data.tar.gz: f14a7b3ceb47de8c0e9f0b0d8f3a34e73e230259a94430c24c9b429d4be34722e4a7f96b5840c36566cbc054d164e777ed3a5d68e36fe84b184b50b34824646c
@@ -12,13 +12,13 @@ module SwitchmanInstJobs
12
12
  module Backend
13
13
  module Base
14
14
  module ClassMethods
15
- def enqueue(object, options = {})
15
+ def enqueue(object, **options)
16
16
  ::Switchman::Shard.periodic_clear_shard_cache
17
17
  current_shard = ::Switchman::Shard.current
18
18
  enqueue_options = options.merge(
19
19
  current_shard: current_shard
20
20
  )
21
- enqueue_job = -> { ::GuardRail.activate(:master) { super(object, enqueue_options) } }
21
+ enqueue_job = -> { ::GuardRail.activate(:master) { super(object, **enqueue_options) } }
22
22
 
23
23
  # Another dj shard must be currently manually activated, so just use that
24
24
  # In general this will only happen in unusual circumstances like tests
@@ -1,8 +1,8 @@
1
1
  module SwitchmanInstJobs
2
2
  module Delayed
3
3
  module MessageSending
4
- def send_later_enqueue_args(method, _enqueue_args = {}, *args)
5
- return send(method, *args) if ::Switchman::DatabaseServer.creating_new_shard
4
+ def delay(**enqueue_args)
5
+ return self if ::Switchman::DatabaseServer.creating_new_shard
6
6
 
7
7
  super
8
8
  end
@@ -32,9 +32,7 @@ module SwitchmanInstJobs
32
32
  singleton = <<~SINGLETON
33
33
  periodic: Delayed::Worker::HealthCheck.reschedule_abandoned_jobs:#{shard.id}
34
34
  SINGLETON
35
- send_later_enqueue_args(
36
- :reschedule_abandoned_jobs, { singleton: singleton }, call_super: shard
37
- )
35
+ delay(singleton: singleton).reschedule_abandoned_jobs(call_super: shard)
38
36
  end
39
37
  end
40
38
  end
@@ -95,7 +95,7 @@ module SwitchmanInstJobs
95
95
  first = this_strand_scope.where('locked_by IS NOT NULL').next_in_strand_order.lock.first
96
96
  if first
97
97
  first_job = ::Delayed::Job.create!(strand: strand, next_in_strand: false)
98
- first_job.payload_object = ::Delayed::PerformableMethod.new(Kernel, :sleep, [0])
98
+ first_job.payload_object = ::Delayed::PerformableMethod.new(Kernel, :sleep, args: [0])
99
99
  first_job.queue = first.queue
100
100
  first_job.tag = 'Kernel.sleep'
101
101
  first_job.source = 'JobsMigrator::StrandBlocker'
@@ -1,3 +1,3 @@
1
1
  module SwitchmanInstJobs
2
- VERSION = '2.0.0'.freeze
2
+ VERSION = '3.0.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,35 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: switchman-inst-jobs
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryan Petty
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-06 00:00:00.000000000 Z
11
+ date: 2020-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: inst-jobs
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0.16'
20
- - - "<"
17
+ - - "~>"
21
18
  - !ruby/object:Gem::Version
22
- version: '0.17'
19
+ version: '1.0'
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- version: '0.16'
30
- - - "<"
24
+ - - "~>"
31
25
  - !ruby/object:Gem::Version
32
- version: '0.17'
26
+ version: '1.0'
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: parallel
35
29
  requirement: !ruby/object:Gem::Requirement
@@ -168,14 +162,14 @@ dependencies:
168
162
  requirements:
169
163
  - - "~>"
170
164
  - !ruby/object:Gem::Version
171
- version: '12'
165
+ version: '13'
172
166
  type: :development
173
167
  prerelease: false
174
168
  version_requirements: !ruby/object:Gem::Requirement
175
169
  requirements:
176
170
  - - "~>"
177
171
  - !ruby/object:Gem::Version
178
- version: '12'
172
+ version: '13'
179
173
  - !ruby/object:Gem::Dependency
180
174
  name: rspec
181
175
  requirement: !ruby/object:Gem::Requirement
@@ -334,7 +328,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
334
328
  - !ruby/object:Gem::Version
335
329
  version: '0'
336
330
  requirements: []
337
- rubygems_version: 3.1.2
331
+ rubygems_version: 3.1.4
338
332
  signing_key:
339
333
  specification_version: 4
340
334
  summary: Switchman and Instructure Jobs compatibility gem.