inst-jobs 2.1.1 → 2.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/delayed/backend/active_record.rb +10 -16
- data/lib/delayed/backend/base.rb +4 -0
- data/lib/delayed/backend/redis/job.rb +0 -7
- data/lib/delayed/periodic.rb +1 -4
- data/lib/delayed/pool.rb +31 -0
- data/lib/delayed/settings.rb +1 -0
- data/lib/delayed/version.rb +1 -1
- data/lib/delayed/worker.rb +5 -1
- data/lib/delayed/worker/consul_health_check.rb +17 -20
- data/lib/delayed/worker/health_check.rb +7 -6
- data/lib/delayed_job.rb +1 -0
- data/spec/active_record_job_spec.rb +15 -4
- data/spec/delayed/periodic_spec.rb +1 -9
- data/spec/delayed/worker/consul_health_check_spec.rb +23 -36
- data/spec/gemfiles/52.gemfile +3 -3
- data/spec/gemfiles/60.gemfile +3 -3
- data/spec/gemfiles/61.gemfile +7 -0
- data/spec/shared/worker.rb +1 -1
- data/spec/spec_helper.rb +4 -12
- metadata +62 -38
- data/spec/gemfiles/42.gemfile +0 -7
- data/spec/gemfiles/50.gemfile +0 -7
- data/spec/gemfiles/51.gemfile +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ab1bd6816331fee7e233542126f85236688fc647050bfc18a1b635e78cd34e5
|
4
|
+
data.tar.gz: 8b5a8e483f8052ed8a01b77a5a610d06bb9b4f3b59b253982d96c353a24fa113
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1affab489a4655084667dee40a487964da7c50780e7124b15ed18b7319bad1db6606f11bde3e109feef9d09ed94c2fd7d70b5c8f0da049c6f3411f5d9d4bf67
|
7
|
+
data.tar.gz: eae5d0a5db108e6f0ed92567a466a1663a411fdeac386b159eba906d26f05bea199ef495c020f43ae10d03d6bf6efdfa198e8b39f46caf8d0fb7e8f2a7192704
|
@@ -13,9 +13,13 @@ end
|
|
13
13
|
module Delayed
|
14
14
|
module Backend
|
15
15
|
module ActiveRecord
|
16
|
+
class AbstractJob < ::ActiveRecord::Base
|
17
|
+
self.abstract_class = true
|
18
|
+
end
|
19
|
+
|
16
20
|
# A job object that is persisted to the database.
|
17
21
|
# Contains the work object as a YAML field.
|
18
|
-
class Job <
|
22
|
+
class Job < AbstractJob
|
19
23
|
include Delayed::Backend::Base
|
20
24
|
self.table_name = :delayed_jobs
|
21
25
|
|
@@ -27,7 +31,7 @@ module Delayed
|
|
27
31
|
|
28
32
|
class << self
|
29
33
|
def create(attributes, &block)
|
30
|
-
return super if connection.prepared_statements
|
34
|
+
return super if connection.prepared_statements
|
31
35
|
|
32
36
|
# modified from ActiveRecord::Persistence.create and ActiveRecord::Persistence#_insert_record
|
33
37
|
job = new(attributes, &block)
|
@@ -37,7 +41,7 @@ module Delayed
|
|
37
41
|
|
38
42
|
def single_step_create
|
39
43
|
connection = self.class.connection
|
40
|
-
return save if connection.prepared_statements
|
44
|
+
return save if connection.prepared_statements
|
41
45
|
|
42
46
|
# a before_save callback that we're skipping
|
43
47
|
initialize_defaults
|
@@ -66,7 +70,8 @@ module Delayed
|
|
66
70
|
# > Multiple queries sent in a single PQexec call are processed in a single transaction,
|
67
71
|
# unless there are explicit BEGIN/COMMIT commands included in the query string to divide
|
68
72
|
# it into multiple transactions.
|
69
|
-
|
73
|
+
# but we don't need to lock when inserting into Delayed::Failed
|
74
|
+
sql = "SELECT pg_advisory_xact_lock(#{connection.quote_table_name('half_md5_as_bigint')}(#{connection.quote(values['strand'])})); #{sql}" if values["strand"] && self.class == Job
|
70
75
|
result = connection.execute(sql, "#{self} Create")
|
71
76
|
self.id = result.values.first.first
|
72
77
|
result.clear
|
@@ -98,7 +103,7 @@ module Delayed
|
|
98
103
|
# to raise the lock level
|
99
104
|
before_create :lock_strand_on_create
|
100
105
|
def lock_strand_on_create
|
101
|
-
if strand.present?
|
106
|
+
if strand.present? && self.class == Job
|
102
107
|
self.class.connection.execute("SELECT pg_advisory_xact_lock(#{self.class.connection.quote_table_name('half_md5_as_bigint')}(#{self.class.connection.quote(strand)}))")
|
103
108
|
end
|
104
109
|
end
|
@@ -513,17 +518,6 @@ module Delayed
|
|
513
518
|
class Failed < Job
|
514
519
|
include Delayed::Backend::Base
|
515
520
|
self.table_name = :failed_jobs
|
516
|
-
# Rails hasn't completely loaded yet, and setting the table name will cache some stuff
|
517
|
-
# so reset that cache so that it will load correctly after Rails is all loaded
|
518
|
-
# It's fixed in Rails 5 to not cache anything when you set the table_name
|
519
|
-
if Rails.version < '5' && Rails.version >= '4.2'
|
520
|
-
@arel_engine = nil
|
521
|
-
@arel_table = nil
|
522
|
-
end
|
523
|
-
end
|
524
|
-
if Rails.version < '5' && Rails.version >= '4.2'
|
525
|
-
@arel_engine = nil
|
526
|
-
@arel_table = nil
|
527
521
|
end
|
528
522
|
end
|
529
523
|
|
data/lib/delayed/backend/base.rb
CHANGED
@@ -87,6 +87,10 @@ module Delayed
|
|
87
87
|
batches[batch_enqueue_args] << kwargs
|
88
88
|
return true
|
89
89
|
else
|
90
|
+
if kwargs[:on_conflict].present?
|
91
|
+
Delayed::Logging.logger.warn("[DELAYED_JOB] WARNING: providing 'on_conflict' as an option to a non-singleton job will have no effect. Discarding.")
|
92
|
+
kwargs.delete(:on_conflict)
|
93
|
+
end
|
90
94
|
job = self.create(**kwargs)
|
91
95
|
end
|
92
96
|
|
data/lib/delayed/periodic.rb
CHANGED
@@ -56,10 +56,7 @@ class Periodic
|
|
56
56
|
inferred_args = {
|
57
57
|
max_attempts: 1,
|
58
58
|
run_at: @cron.next_time(Delayed::Periodic.now).utc.to_time,
|
59
|
-
singleton:
|
60
|
-
# yes, checking for whether it is actually the boolean literal false,
|
61
|
-
# which means the consuming code really does not want this job to be
|
62
|
-
# a singleton at all.
|
59
|
+
singleton: tag,
|
63
60
|
on_conflict: :patient
|
64
61
|
}
|
65
62
|
@job_args.merge(inferred_args)
|
data/lib/delayed/pool.rb
CHANGED
@@ -39,6 +39,7 @@ class Pool
|
|
39
39
|
Process.wait unlock_pid
|
40
40
|
|
41
41
|
spawn_periodic_auditor
|
42
|
+
spawn_abandoned_job_cleanup
|
42
43
|
spawn_all_workers
|
43
44
|
say "Workers spawned"
|
44
45
|
join
|
@@ -111,6 +112,34 @@ class Pool
|
|
111
112
|
end
|
112
113
|
end
|
113
114
|
|
115
|
+
def spawn_abandoned_job_cleanup
|
116
|
+
return if Settings.disable_abandoned_job_cleanup
|
117
|
+
cleanup_interval_in_minutes = 60
|
118
|
+
@abandoned_cleanup_thread = Thread.new do
|
119
|
+
# every hour (staggered by process)
|
120
|
+
# check for dead jobs and cull them.
|
121
|
+
# Will actually be more often based on the
|
122
|
+
# number of worker nodes in the pool. This will actually
|
123
|
+
# be a max of N times per hour where N is the number of workers,
|
124
|
+
# but they won't overrun each other because the health check
|
125
|
+
# takes an advisory lock internally
|
126
|
+
sleep(rand(cleanup_interval_in_minutes * 60))
|
127
|
+
loop do
|
128
|
+
schedule_abandoned_job_cleanup
|
129
|
+
sleep(cleanup_interval_in_minutes * 60)
|
130
|
+
end
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
def schedule_abandoned_job_cleanup
|
135
|
+
pid = fork_with_reconnects do
|
136
|
+
# we want to avoid db connections in the main pool process
|
137
|
+
$0 = "delayed_abandoned_job_cleanup"
|
138
|
+
Delayed::Worker::HealthCheck.reschedule_abandoned_jobs
|
139
|
+
end
|
140
|
+
workers[pid] = :abandoned_job_cleanup
|
141
|
+
end
|
142
|
+
|
114
143
|
def spawn_periodic_auditor
|
115
144
|
return if Settings.disable_periodic_jobs
|
116
145
|
|
@@ -217,6 +246,8 @@ class Pool
|
|
217
246
|
case worker
|
218
247
|
when :periodic_audit
|
219
248
|
say "ran auditor: #{worker}"
|
249
|
+
when :abandoned_job_cleanup
|
250
|
+
say "ran cleanup: #{worker}"
|
220
251
|
when :work_queue
|
221
252
|
say "work queue exited, restarting", :info
|
222
253
|
spawn_work_queue
|
data/lib/delayed/settings.rb
CHANGED
data/lib/delayed/version.rb
CHANGED
data/lib/delayed/worker.rb
CHANGED
@@ -9,52 +9,49 @@ module Delayed
|
|
9
9
|
class ConsulHealthCheck < HealthCheck
|
10
10
|
self.type_name = :consul
|
11
11
|
|
12
|
-
CONSUL_CONFIG_KEYS = %w{url
|
12
|
+
CONSUL_CONFIG_KEYS = %w{url acl_token}.map(&:freeze).freeze
|
13
13
|
DEFAULT_SERVICE_NAME = 'inst-jobs_worker'.freeze
|
14
|
-
attr_reader :
|
14
|
+
attr_reader :service_client, :health_client
|
15
15
|
|
16
16
|
def initialize(*, **)
|
17
17
|
super
|
18
18
|
# Because we don't want the consul client to be a hard dependency we're
|
19
19
|
# only requiring it once it's absolutely needed
|
20
|
-
require '
|
20
|
+
require 'diplomat'
|
21
21
|
|
22
22
|
if config.keys.any? { |k| CONSUL_CONFIG_KEYS.include?(k) }
|
23
|
-
consul_config =
|
23
|
+
consul_config = Diplomat::Configuration.new.tap do |conf|
|
24
24
|
CONSUL_CONFIG_KEYS.each do |key|
|
25
25
|
conf.send("#{key}=", config[key]) if config[key]
|
26
26
|
end
|
27
27
|
end
|
28
|
-
@
|
29
|
-
@
|
28
|
+
@service_client = Diplomat::Service.new(configuration: consul_config)
|
29
|
+
@health_client = Diplomat::Health.new(configuration: consul_config)
|
30
30
|
else
|
31
|
-
@
|
32
|
-
@
|
31
|
+
@service_client = Diplomat::Service.new
|
32
|
+
@health_client = Diplomat::Health.new
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
36
|
def start
|
37
|
-
|
37
|
+
@service_client.register({
|
38
38
|
id: worker_name,
|
39
39
|
name: service_name,
|
40
|
+
check: check_attributes
|
40
41
|
})
|
41
|
-
service.add_check(check_attributes)
|
42
|
-
response = @agent_client.register_service(service)
|
43
|
-
response.ok?
|
44
42
|
end
|
45
43
|
|
46
44
|
def stop
|
47
|
-
|
48
|
-
response.ok? || response.not_found?
|
45
|
+
@service_client.deregister(worker_name)
|
49
46
|
end
|
50
47
|
|
51
48
|
def live_workers
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
49
|
+
# Filter out critical workers (probably nodes failing their serf health check)
|
50
|
+
live_nodes = @health_client.service(service_name, {
|
51
|
+
filter: 'not Checks.Status == critical'
|
52
|
+
})
|
53
|
+
|
54
|
+
live_nodes.map { |n| n.Service['ID']}
|
58
55
|
end
|
59
56
|
|
60
57
|
private
|
@@ -23,12 +23,13 @@ module Delayed
|
|
23
23
|
def reschedule_abandoned_jobs
|
24
24
|
return if Settings.worker_health_check_type == :none
|
25
25
|
Delayed::Job.transaction do
|
26
|
-
# this
|
26
|
+
# this action is a special case, and SHOULD NOT be a periodic job
|
27
27
|
# because if it gets wiped out suddenly during execution
|
28
28
|
# it can't go clean up it's abandoned self. Therefore,
|
29
|
-
# we
|
30
|
-
#
|
31
|
-
#
|
29
|
+
# we expect it to get run from it's own process forked from the job pool
|
30
|
+
# and we try to get an advisory lock when it runs. If we succeed,
|
31
|
+
# no other worker is trying to do this right now (and if we abandon the
|
32
|
+
# operation, the transaction will end, releasing the advisory lock).
|
32
33
|
result = attempt_advisory_lock
|
33
34
|
return unless result
|
34
35
|
checker = Worker::HealthCheck.build(
|
@@ -59,8 +60,8 @@ module Delayed
|
|
59
60
|
|
60
61
|
def attempt_advisory_lock
|
61
62
|
lock_name = "Delayed::Worker::HealthCheck#reschedule_abandoned_jobs"
|
62
|
-
|
63
|
-
|
63
|
+
conn = ActiveRecord::Base.connection
|
64
|
+
conn.select_value("SELECT pg_try_advisory_xact_lock(#{conn.quote_table_name('half_md5_as_bigint')}('#{lock_name}'));")
|
64
65
|
end
|
65
66
|
end
|
66
67
|
|
data/lib/delayed_job.rb
CHANGED
@@ -262,8 +262,6 @@ describe 'Delayed::Backed::ActiveRecord::Job' do
|
|
262
262
|
|
263
263
|
context "non-transactional", non_transactional: true do
|
264
264
|
it "creates a stranded job in a single statement" do
|
265
|
-
skip "Requires Rails 5.2 or greater" unless Rails.version >= '5.2'
|
266
|
-
|
267
265
|
allow(Delayed::Job.connection).to receive(:prepared_statements).and_return(false)
|
268
266
|
allow(Delayed::Job.connection).to receive(:execute).with(be_include("pg_advisory_xact_lock"), anything).and_call_original.once
|
269
267
|
allow(Delayed::Job.connection).to receive(:insert).never
|
@@ -273,8 +271,6 @@ describe 'Delayed::Backed::ActiveRecord::Job' do
|
|
273
271
|
end
|
274
272
|
|
275
273
|
it "creates a non-stranded job in a single statement" do
|
276
|
-
skip "Requires Rails 5.2 or greater" unless Rails.version >= '5.2'
|
277
|
-
|
278
274
|
allow(Delayed::Job.connection).to receive(:prepared_statements).and_return(false)
|
279
275
|
call_count = 0
|
280
276
|
allow(Delayed::Job.connection).to receive(:execute).and_wrap_original do |m, (arg1, arg2)|
|
@@ -286,5 +282,20 @@ describe 'Delayed::Backed::ActiveRecord::Job' do
|
|
286
282
|
expect(call_count).to eq 1
|
287
283
|
expect(Delayed::Job.find(j.id)).to eq j
|
288
284
|
end
|
285
|
+
|
286
|
+
it "does not lock a stranded failed job creation" do
|
287
|
+
j = create_job(strand: "test1")
|
288
|
+
# query for metadata to ensure it's loaded before we start mucking with the connection
|
289
|
+
Delayed::Backend::ActiveRecord::Job::Failed.new
|
290
|
+
|
291
|
+
allow(Delayed::Job.connection).to receive(:prepared_statements).and_return(false)
|
292
|
+
allow(Delayed::Job.connection).to receive(:execute).and_wrap_original do |original, *args|
|
293
|
+
expect(args.first).not_to include("pg_advisory_xact_lock")
|
294
|
+
original.call(*args)
|
295
|
+
end
|
296
|
+
allow(Delayed::Job.connection).to receive(:insert).never
|
297
|
+
j.fail!
|
298
|
+
allow(Delayed::Job.connection).to receive(:execute).and_call_original
|
299
|
+
end
|
289
300
|
end
|
290
301
|
end
|
@@ -14,6 +14,7 @@ RSpec.describe Delayed::Periodic do
|
|
14
14
|
ensure
|
15
15
|
Delayed::Periodic.scheduled = prev_sched
|
16
16
|
Delayed::Periodic.overrides = prev_ovr
|
17
|
+
Delayed::Job.delete_all
|
17
18
|
end
|
18
19
|
|
19
20
|
describe ".cron" do
|
@@ -26,14 +27,5 @@ RSpec.describe Delayed::Periodic do
|
|
26
27
|
expect(instance).to_not be_nil
|
27
28
|
expect(instance.enqueue_args[:singleton]).to eq("periodic: just a test")
|
28
29
|
end
|
29
|
-
|
30
|
-
it "uses no singleton if told to skip" do
|
31
|
-
Delayed::Periodic.cron job_name, '*/10 * * * *', {singleton: false} do
|
32
|
-
# no-op
|
33
|
-
end
|
34
|
-
instance = Delayed::Periodic.scheduled[job_name]
|
35
|
-
expect(instance).to_not be_nil
|
36
|
-
expect(instance.enqueue_args[:singleton]).to be_nil
|
37
|
-
end
|
38
30
|
end
|
39
31
|
end
|
@@ -1,76 +1,63 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
|
-
require 'imperium'
|
5
4
|
|
6
5
|
RSpec.describe Delayed::Worker::ConsulHealthCheck do
|
7
6
|
let(:health_check) { Delayed::Worker::ConsulHealthCheck.new(worker_name: 'foobar') }
|
8
7
|
|
9
|
-
# can't use a verifying double for the response because the methods we're
|
10
|
-
# tryig to stub are actually on HTTP::Message
|
11
|
-
let(:response) { double('Imperium::Response') }
|
12
|
-
let(:agent_client) { instance_double(Imperium::Agent) }
|
13
|
-
|
14
|
-
before do
|
15
|
-
allow(Imperium::Agent).to receive(:default_client).and_return(agent_client)
|
16
|
-
end
|
17
|
-
|
18
8
|
describe '#initialize' do
|
19
|
-
it 'must use
|
9
|
+
it 'must use a default service client when the config is mostly empty' do
|
20
10
|
check = Delayed::Worker::ConsulHealthCheck.new(worker_name: 'foobar')
|
21
|
-
expect(check.
|
11
|
+
expect(check.service_client.configuration.url.to_s).to eq 'http://localhost:8500'
|
22
12
|
end
|
23
13
|
|
24
|
-
it 'must create a new
|
14
|
+
it 'must create a new service API client when the config has relevant keys set' do
|
25
15
|
check = Delayed::Worker::ConsulHealthCheck.new(worker_name: 'foobar', config: {url: 'http://consul.example.com:8500'})
|
26
|
-
|
27
|
-
expect(
|
28
|
-
expect(agent_client.config.url.to_s).to eq 'http://consul.example.com:8500'
|
16
|
+
service_client = check.service_client
|
17
|
+
expect(service_client.configuration.url.to_s).to eq 'http://consul.example.com:8500'
|
29
18
|
end
|
30
19
|
end
|
31
20
|
|
32
21
|
describe '#start' do
|
33
22
|
it 'must register this process as a service with consul' do
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
.and_return(response)
|
23
|
+
stub = stub_request(:put, "localhost:8500/v1/agent/service/register")
|
24
|
+
.with(body: hash_including({id: 'foobar' }))
|
25
|
+
|
38
26
|
health_check.start
|
27
|
+
|
28
|
+
expect(stub).to have_been_requested
|
39
29
|
end
|
40
30
|
|
41
31
|
|
42
32
|
it 'must supply a args style check' do
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
expect(check.args).to_not be_nil
|
47
|
-
response
|
48
|
-
}
|
33
|
+
stub = stub_request(:put, "localhost:8500/v1/agent/service/register")
|
34
|
+
.with(body: hash_including({check: WebMock::API.hash_including({args: anything})}))
|
35
|
+
|
49
36
|
health_check.start
|
37
|
+
|
38
|
+
expect(stub).to have_been_requested
|
50
39
|
end
|
51
40
|
|
52
41
|
it 'must include the docker container id when the docker option is set to true' do
|
42
|
+
stub = stub_request(:put, "localhost:8500/v1/agent/service/register")
|
43
|
+
.with(body: hash_including({check: WebMock::API.hash_including({docker_container_id: anything})}))
|
44
|
+
|
53
45
|
local_health_check = Delayed::Worker::ConsulHealthCheck.new(
|
54
46
|
worker_name: 'foobar',
|
55
47
|
config: {docker: true}
|
56
48
|
)
|
57
|
-
allow(response).to receive(:ok?).and_return(true)
|
58
|
-
allow(agent_client).to receive(:register_service) { |service|
|
59
|
-
check = service.checks.first
|
60
|
-
expect(check.docker_container_id).to_not be_nil
|
61
|
-
response
|
62
|
-
}
|
63
49
|
local_health_check.start
|
50
|
+
|
51
|
+
expect(stub).to have_been_requested
|
64
52
|
end
|
65
53
|
end
|
66
54
|
|
67
55
|
describe '#stop' do
|
68
56
|
it 'must deregister the service from consul' do
|
69
|
-
|
70
|
-
|
71
|
-
.with(health_check.worker_name)
|
72
|
-
.and_return(response)
|
57
|
+
stub = stub_request(:put, "localhost:8500/v1/agent/service/deregister/foobar")
|
58
|
+
|
73
59
|
health_check.stop
|
60
|
+
expect(stub).to have_been_requested
|
74
61
|
end
|
75
62
|
end
|
76
63
|
end
|
data/spec/gemfiles/52.gemfile
CHANGED
data/spec/gemfiles/60.gemfile
CHANGED
data/spec/shared/worker.rb
CHANGED
@@ -21,7 +21,7 @@ shared_examples_for 'Delayed::Worker' do
|
|
21
21
|
|
22
22
|
describe "running a job" do
|
23
23
|
it "should not fail when running a job with a % in the name" do
|
24
|
-
@job = "Some % Name here".delay(ignore_transaction: true).
|
24
|
+
@job = "Some % Name here".delay(ignore_transaction: true).start_with?("Some % Name")
|
25
25
|
@worker.perform(@job)
|
26
26
|
end
|
27
27
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -5,8 +5,9 @@ require 'delayed/testing'
|
|
5
5
|
|
6
6
|
require 'database_cleaner'
|
7
7
|
require 'rack/test'
|
8
|
-
require 'test_after_commit' if ::Rails.version < '5'
|
9
8
|
require 'timecop'
|
9
|
+
require 'webmock/rspec'
|
10
|
+
|
10
11
|
require 'pry'
|
11
12
|
require 'byebug'
|
12
13
|
|
@@ -19,6 +20,7 @@ RSpec.configure do |config|
|
|
19
20
|
config.before(:suite) do
|
20
21
|
DatabaseCleaner.strategy = :transaction
|
21
22
|
DatabaseCleaner.clean_with(:truncation)
|
23
|
+
WebMock.disable_net_connect!
|
22
24
|
end
|
23
25
|
|
24
26
|
config.before(:each) do |example|
|
@@ -60,18 +62,8 @@ connection_config = {
|
|
60
62
|
database: ENV['TEST_DB_DATABASE'],
|
61
63
|
}
|
62
64
|
|
63
|
-
if ::Rails.version < '5'
|
64
|
-
class ActiveRecord::Migration
|
65
|
-
class << self
|
66
|
-
def [](_version); self; end
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|
70
|
-
|
71
65
|
def migrate(file)
|
72
|
-
if ::Rails.version
|
73
|
-
ActiveRecord::Migrator.migrate(file)
|
74
|
-
elsif ::Rails.version >= '6'
|
66
|
+
if ::Rails.version >= '6'
|
75
67
|
ActiveRecord::MigrationContext.new(file, ActiveRecord::SchemaMigration).migrate
|
76
68
|
else
|
77
69
|
ActiveRecord::MigrationContext.new(file).migrate
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inst-jobs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Luetke
|
8
8
|
- Brian Palmer
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2021-05-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|
@@ -17,28 +17,28 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '
|
20
|
+
version: '5.2'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: '
|
27
|
+
version: '5.2'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: activesupport
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
32
|
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: '
|
34
|
+
version: '5.2'
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: '
|
41
|
+
version: '5.2'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: after_transaction_commit
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -65,14 +65,14 @@ dependencies:
|
|
65
65
|
requirements:
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '5.2'
|
69
69
|
type: :runtime
|
70
70
|
prerelease: false
|
71
71
|
version_requirements: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '5.2'
|
76
76
|
- !ruby/object:Gem::Dependency
|
77
77
|
name: redis
|
78
78
|
requirement: !ruby/object:Gem::Requirement
|
@@ -121,14 +121,14 @@ dependencies:
|
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version:
|
124
|
+
version: '1.0'
|
125
125
|
type: :runtime
|
126
126
|
prerelease: false
|
127
127
|
version_requirements: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
131
|
+
version: '1.0'
|
132
132
|
- !ruby/object:Gem::Dependency
|
133
133
|
name: bump
|
134
134
|
requirement: !ruby/object:Gem::Requirement
|
@@ -161,44 +161,58 @@ dependencies:
|
|
161
161
|
name: database_cleaner
|
162
162
|
requirement: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
|
-
- -
|
164
|
+
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version:
|
166
|
+
version: '2.0'
|
167
167
|
type: :development
|
168
168
|
prerelease: false
|
169
169
|
version_requirements: !ruby/object:Gem::Requirement
|
170
170
|
requirements:
|
171
|
-
- -
|
171
|
+
- - "~>"
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version:
|
173
|
+
version: '2.0'
|
174
174
|
- !ruby/object:Gem::Dependency
|
175
|
-
name:
|
175
|
+
name: database_cleaner-active_record
|
176
176
|
requirement: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
|
-
- - "
|
178
|
+
- - "~>"
|
179
179
|
- !ruby/object:Gem::Version
|
180
|
-
version: 0
|
180
|
+
version: '2.0'
|
181
181
|
type: :development
|
182
182
|
prerelease: false
|
183
183
|
version_requirements: !ruby/object:Gem::Requirement
|
184
184
|
requirements:
|
185
|
-
- - "
|
185
|
+
- - "~>"
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '2.0'
|
188
|
+
- !ruby/object:Gem::Dependency
|
189
|
+
name: diplomat
|
190
|
+
requirement: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - "~>"
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: 2.5.1
|
195
|
+
type: :development
|
196
|
+
prerelease: false
|
197
|
+
version_requirements: !ruby/object:Gem::Requirement
|
198
|
+
requirements:
|
199
|
+
- - "~>"
|
186
200
|
- !ruby/object:Gem::Version
|
187
|
-
version:
|
201
|
+
version: 2.5.1
|
188
202
|
- !ruby/object:Gem::Dependency
|
189
203
|
name: pg
|
190
204
|
requirement: !ruby/object:Gem::Requirement
|
191
205
|
requirements:
|
192
|
-
- - "
|
206
|
+
- - ">="
|
193
207
|
- !ruby/object:Gem::Version
|
194
|
-
version: '
|
208
|
+
version: '0'
|
195
209
|
type: :development
|
196
210
|
prerelease: false
|
197
211
|
version_requirements: !ruby/object:Gem::Requirement
|
198
212
|
requirements:
|
199
|
-
- - "
|
213
|
+
- - ">="
|
200
214
|
- !ruby/object:Gem::Version
|
201
|
-
version: '
|
215
|
+
version: '0'
|
202
216
|
- !ruby/object:Gem::Dependency
|
203
217
|
name: pry
|
204
218
|
requirement: !ruby/object:Gem::Requirement
|
@@ -261,14 +275,14 @@ dependencies:
|
|
261
275
|
requirements:
|
262
276
|
- - "~>"
|
263
277
|
- !ruby/object:Gem::Version
|
264
|
-
version: 3.
|
278
|
+
version: '3.10'
|
265
279
|
type: :development
|
266
280
|
prerelease: false
|
267
281
|
version_requirements: !ruby/object:Gem::Requirement
|
268
282
|
requirements:
|
269
283
|
- - "~>"
|
270
284
|
- !ruby/object:Gem::Version
|
271
|
-
version: 3.
|
285
|
+
version: '3.10'
|
272
286
|
- !ruby/object:Gem::Dependency
|
273
287
|
name: sinatra
|
274
288
|
requirement: !ruby/object:Gem::Requirement
|
@@ -303,14 +317,28 @@ dependencies:
|
|
303
317
|
requirements:
|
304
318
|
- - '='
|
305
319
|
- !ruby/object:Gem::Version
|
306
|
-
version: 0.
|
320
|
+
version: 0.9.4
|
307
321
|
type: :development
|
308
322
|
prerelease: false
|
309
323
|
version_requirements: !ruby/object:Gem::Requirement
|
310
324
|
requirements:
|
311
325
|
- - '='
|
312
326
|
- !ruby/object:Gem::Version
|
313
|
-
version: 0.
|
327
|
+
version: 0.9.4
|
328
|
+
- !ruby/object:Gem::Dependency
|
329
|
+
name: webmock
|
330
|
+
requirement: !ruby/object:Gem::Requirement
|
331
|
+
requirements:
|
332
|
+
- - ">="
|
333
|
+
- !ruby/object:Gem::Version
|
334
|
+
version: '0'
|
335
|
+
type: :development
|
336
|
+
prerelease: false
|
337
|
+
version_requirements: !ruby/object:Gem::Requirement
|
338
|
+
requirements:
|
339
|
+
- - ">="
|
340
|
+
- !ruby/object:Gem::Version
|
341
|
+
version: '0'
|
314
342
|
- !ruby/object:Gem::Dependency
|
315
343
|
name: wwtd
|
316
344
|
requirement: !ruby/object:Gem::Requirement
|
@@ -325,7 +353,7 @@ dependencies:
|
|
325
353
|
- - "~>"
|
326
354
|
- !ruby/object:Gem::Version
|
327
355
|
version: 1.4.0
|
328
|
-
description:
|
356
|
+
description:
|
329
357
|
email:
|
330
358
|
- brianp@instructure.com
|
331
359
|
executables:
|
@@ -422,11 +450,9 @@ files:
|
|
422
450
|
- spec/delayed/worker/consul_health_check_spec.rb
|
423
451
|
- spec/delayed/worker/health_check_spec.rb
|
424
452
|
- spec/delayed/worker_spec.rb
|
425
|
-
- spec/gemfiles/42.gemfile
|
426
|
-
- spec/gemfiles/50.gemfile
|
427
|
-
- spec/gemfiles/51.gemfile
|
428
453
|
- spec/gemfiles/52.gemfile
|
429
454
|
- spec/gemfiles/60.gemfile
|
455
|
+
- spec/gemfiles/61.gemfile
|
430
456
|
- spec/migrate/20140924140513_add_story_table.rb
|
431
457
|
- spec/redis_job_spec.rb
|
432
458
|
- spec/sample_jobs.rb
|
@@ -441,7 +467,7 @@ files:
|
|
441
467
|
homepage: https://github.com/instructure/inst-jobs
|
442
468
|
licenses: []
|
443
469
|
metadata: {}
|
444
|
-
post_install_message:
|
470
|
+
post_install_message:
|
445
471
|
rdoc_options: []
|
446
472
|
require_paths:
|
447
473
|
- lib
|
@@ -456,19 +482,17 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
456
482
|
- !ruby/object:Gem::Version
|
457
483
|
version: '0'
|
458
484
|
requirements: []
|
459
|
-
rubygems_version: 3.
|
460
|
-
signing_key:
|
485
|
+
rubygems_version: 3.2.15
|
486
|
+
signing_key:
|
461
487
|
specification_version: 4
|
462
488
|
summary: Instructure-maintained fork of delayed_job
|
463
489
|
test_files:
|
464
490
|
- spec/sample_jobs.rb
|
465
491
|
- spec/spec_helper.rb
|
466
492
|
- spec/redis_job_spec.rb
|
493
|
+
- spec/gemfiles/61.gemfile
|
467
494
|
- spec/gemfiles/60.gemfile
|
468
|
-
- spec/gemfiles/42.gemfile
|
469
495
|
- spec/gemfiles/52.gemfile
|
470
|
-
- spec/gemfiles/50.gemfile
|
471
|
-
- spec/gemfiles/51.gemfile
|
472
496
|
- spec/shared_jobs_specs.rb
|
473
497
|
- spec/shared/performable_method.rb
|
474
498
|
- spec/shared/testing.rb
|
data/spec/gemfiles/42.gemfile
DELETED
data/spec/gemfiles/50.gemfile
DELETED