switchman-inst-jobs 4.0.6 → 4.0.9

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: 61fb55d3fff48ff95a3fae70acc49935250642ac4b2b24d3ece10e9d5624e1dd
4
- data.tar.gz: 8544c358faaa63992a5db35db5d1d2a7317048349d91857d9b0241b02ec30b13
3
+ metadata.gz: c6453b4fb5882411028c48e458ec49ee8dd14686b6baa889053bdc44c0f43ecc
4
+ data.tar.gz: b5883129b65be01ce10acdb373bdd8bcc95c76e8a18eb4326cb2590b71ead518
5
5
  SHA512:
6
- metadata.gz: f4601a44b1c795edb3302f5b9174292ff7724315cdb321a0fd9213f44eb72e3ffb0d48195f03426c7701eb32232b550f8bff325ea48f2f89133c7ba2e8039653
7
- data.tar.gz: 8651595cec7bf1f67544e33fe806f1f082fe26809fdadacb7ad86ebfb885436db5c9333e09a1d4c320fc52dee7b1b942fe646524e1ee45d8db62b88b3f116397
6
+ metadata.gz: adc1ed9eb64a227ecbe46f98f92e6b357c595249ad681a4dd3b649fade15b5848ebb4cf15feca35b49ca2c312abe31ef3357941f666be11ad554a1f5cc37892c
7
+ data.tar.gz: f0d8cd82e01d15b698f57417f2b2d88cb0263bbd47cfba167a812158f89a5110e653590b3e125f65c5555e3f580f346bbf5f1de9b0a58cc8f951bd326d348e9e
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddFailedJobsIndicies < ActiveRecord::Migration[5.2]
4
+ disable_ddl_transaction!
5
+
6
+ def change
7
+ add_index :failed_jobs, :failed_at, algorithm: :concurrently
8
+ add_index :failed_jobs, :strand, where: 'strand IS NOT NULL', algorithm: :concurrently
9
+ add_index :failed_jobs, :singleton, where: 'singleton IS NOT NULL', algorithm: :concurrently
10
+ add_index :failed_jobs, :tag, algorithm: :concurrently
11
+ end
12
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddRequeuedJobIdToFailedJobs < ActiveRecord::Migration[6.0]
4
+ def change
5
+ add_column :failed_jobs, :requeued_job_id, :integer, limit: 8
6
+ end
7
+ end
@@ -6,7 +6,9 @@ module SwitchmanInstJobs
6
6
  module ClassMethods
7
7
  def current_switchman_shard
8
8
  connected_to_stack.reverse_each do |hash|
9
- return hash[:switchman_shard] if hash[:switchman_shard] && hash[:klasses].include?(connection_classes)
9
+ if hash[:switchman_shard] && hash[:klasses].include?(connection_class_for_self)
10
+ return hash[:switchman_shard]
11
+ end
10
12
  end
11
13
 
12
14
  ::ActiveRecord::Base.current_switchman_shard.delayed_jobs_shard
@@ -14,7 +14,7 @@ module SwitchmanInstJobs
14
14
  module ClassMethods
15
15
  def enqueue(object, **options)
16
16
  ::Switchman::Shard.periodic_clear_shard_cache
17
- current_shard = ::Switchman::Shard.current
17
+ current_shard = options[:current_shard] || ::Switchman::Shard.current
18
18
  enqueue_options = options.merge(
19
19
  current_shard: current_shard
20
20
  )
@@ -35,8 +35,10 @@ module SwitchmanInstJobs
35
35
  enqueue_options[:next_in_strand] = false
36
36
  end
37
37
 
38
- current_job_shard.activate(::Delayed::Backend::ActiveRecord::AbstractJob) do
39
- enqueue_job.call
38
+ current_shard.activate do
39
+ current_job_shard.activate(::Delayed::Backend::ActiveRecord::AbstractJob) do
40
+ enqueue_job.call
41
+ end
40
42
  end
41
43
  end
42
44
  end
@@ -4,6 +4,7 @@ module SwitchmanInstJobs
4
4
  def delay(sender: nil, synchronous: false, **enqueue_args)
5
5
  sender ||= __calculate_sender_for_delay
6
6
  synchronous ||= ::Switchman::DatabaseServer.creating_new_shard
7
+ enqueue_args[:current_shard] = ::Switchman::Shard.current
7
8
 
8
9
  super
9
10
  end
@@ -1,3 +1,3 @@
1
1
  module SwitchmanInstJobs
2
- VERSION = '4.0.6'.freeze
2
+ VERSION = '4.0.9'.freeze
3
3
  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: 4.0.6
4
+ version: 4.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryan Petty
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-23 00:00:00.000000000 Z
11
+ date: 2022-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: inst-jobs
@@ -53,7 +53,7 @@ dependencies:
53
53
  version: '6.1'
54
54
  - - "<"
55
55
  - !ruby/object:Gem::Version
56
- version: '6.2'
56
+ version: '7.1'
57
57
  type: :runtime
58
58
  prerelease: false
59
59
  version_requirements: !ruby/object:Gem::Requirement
@@ -63,27 +63,35 @@ dependencies:
63
63
  version: '6.1'
64
64
  - - "<"
65
65
  - !ruby/object:Gem::Version
66
- version: '6.2'
66
+ version: '7.1'
67
67
  - !ruby/object:Gem::Dependency
68
68
  name: switchman
69
69
  requirement: !ruby/object:Gem::Requirement
70
70
  requirements:
71
71
  - - "~>"
72
72
  - !ruby/object:Gem::Version
73
- version: '3.0'
74
- - - ">="
75
- - !ruby/object:Gem::Version
76
- version: 3.0.7
73
+ version: '3.1'
77
74
  type: :runtime
78
75
  prerelease: false
79
76
  version_requirements: !ruby/object:Gem::Requirement
80
77
  requirements:
81
78
  - - "~>"
82
79
  - !ruby/object:Gem::Version
83
- version: '3.0'
84
- - - ">="
80
+ version: '3.1'
81
+ - !ruby/object:Gem::Dependency
82
+ name: appraisal
83
+ requirement: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - "~>"
86
+ - !ruby/object:Gem::Version
87
+ version: 2.3.0
88
+ type: :development
89
+ prerelease: false
90
+ version_requirements: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - "~>"
85
93
  - !ruby/object:Gem::Version
86
- version: 3.0.7
94
+ version: 2.3.0
87
95
  - !ruby/object:Gem::Dependency
88
96
  name: bundler
89
97
  requirement: !ruby/object:Gem::Requirement
@@ -280,20 +288,6 @@ dependencies:
280
288
  - - "~>"
281
289
  - !ruby/object:Gem::Version
282
290
  version: '0.21'
283
- - !ruby/object:Gem::Dependency
284
- name: wwtd
285
- requirement: !ruby/object:Gem::Requirement
286
- requirements:
287
- - - "~>"
288
- - !ruby/object:Gem::Version
289
- version: '1.4'
290
- type: :development
291
- prerelease: false
292
- version_requirements: !ruby/object:Gem::Requirement
293
- requirements:
294
- - - "~>"
295
- - !ruby/object:Gem::Version
296
- version: '1.4'
297
291
  description:
298
292
  email:
299
293
  - bpetty@instructure.com
@@ -344,6 +338,8 @@ files:
344
338
  - db/migrate/20220128084800_update_insert_trigger_for_singleton_unique_constraint_change.rb
345
339
  - db/migrate/20220128084900_update_delete_trigger_for_singleton_unique_constraint_change.rb
346
340
  - db/migrate/20220203063200_remove_old_singleton_index.rb
341
+ - db/migrate/20220328152900_add_failed_jobs_indicies.rb
342
+ - db/migrate/20220519204546_add_requeued_job_id_to_failed_jobs.rb
347
343
  - lib/switchman-inst-jobs.rb
348
344
  - lib/switchman_inst_jobs.rb
349
345
  - lib/switchman_inst_jobs/active_record/connection_adapters/postgresql_adapter.rb
@@ -379,14 +375,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
379
375
  requirements:
380
376
  - - ">="
381
377
  - !ruby/object:Gem::Version
382
- version: '2.6'
378
+ version: '2.7'
383
379
  required_rubygems_version: !ruby/object:Gem::Requirement
384
380
  requirements:
385
381
  - - ">="
386
382
  - !ruby/object:Gem::Version
387
383
  version: '0'
388
384
  requirements: []
389
- rubygems_version: 3.1.4
385
+ rubygems_version: 3.1.6
390
386
  signing_key:
391
387
  specification_version: 4
392
388
  summary: Switchman and Instructure Jobs compatibility gem.