delayed_job_groups_plugin 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +29 -17
- data/CHANGELOG.md +3 -0
- data/delayed_job_groups.gemspec +5 -2
- data/lib/delayed/job_groups/job_extensions.rb +6 -7
- data/lib/delayed/job_groups/job_group.rb +2 -2
- data/lib/delayed/job_groups/version.rb +1 -1
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d1a906f965ab26f60407c3a5b10a9e1405b39e3c
|
4
|
+
data.tar.gz: 7cf5b5a7b17135b3de0788de8da05b6852101fc3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac0d877eeac021a5da0d2bf48185fa5507c35e89d8791fd0ccf6de52181cc961c3fde975eee83be4b8dacbb252743f566d35362072c779a59e71c4a515fb497e
|
7
|
+
data.tar.gz: ded7fd3760219acbf979050767a58147c12c2f7aea7ba74523672ea41a21c413399ab64c416adeef7715047fda953aafdb0203cee7955d7e759d79248b7931dd
|
data/.travis.yml
CHANGED
@@ -1,22 +1,34 @@
|
|
1
1
|
language: ruby
|
2
|
+
sudo: false
|
2
3
|
env:
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
global:
|
5
|
+
- JRUBY_OPTS="$JRUBY_OPTS --debug"
|
6
|
+
matrix:
|
7
|
+
- RAILS_VERSION="~> 3.2.22.5"
|
8
|
+
- RAILS_VERSION="~> 4.0.13"
|
9
|
+
- RAILS_VERSION="~> 4.1.16"
|
10
|
+
- RAILS_VERSION="~> 4.2.9"
|
11
|
+
- RAILS_VERSION="~> 5.0.6"
|
12
|
+
- RAILS_VERSION="~> 5.1.3"
|
7
13
|
rvm:
|
8
|
-
- 1.
|
9
|
-
- 2.
|
10
|
-
- 2.
|
11
|
-
- 2.2
|
12
|
-
- jruby-
|
14
|
+
- 2.1.10
|
15
|
+
- 2.2.8
|
16
|
+
- 2.3.5
|
17
|
+
- 2.4.2
|
18
|
+
- jruby-9.1.13.0
|
13
19
|
matrix:
|
14
20
|
exclude:
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
- rvm: 2.2
|
20
|
-
env: RAILS_VERSION="~>
|
21
|
-
|
22
|
-
|
21
|
+
- rvm: 2.1.10
|
22
|
+
env: RAILS_VERSION="~> 5.0.6"
|
23
|
+
- rvm: 2.4.2
|
24
|
+
env: RAILS_VERSION="~> 3.2.22.5"
|
25
|
+
- rvm: 2.4.2
|
26
|
+
env: RAILS_VERSION="~> 4.0.13"
|
27
|
+
- rvm: 2.4.2
|
28
|
+
env: RAILS_VERSION="~> 4.1.16"
|
29
|
+
- rvm: jruby-9.1.13.0
|
30
|
+
env: RAILS_VERSION="~> 5.0.6"
|
31
|
+
- rvm: 2.1.10
|
32
|
+
env: RAILS_VERSION="~> 5.1.3"
|
33
|
+
- rvm: jruby-9.1.13.0
|
34
|
+
env: RAILS_VERSION="~> 5.1.3"
|
data/CHANGELOG.md
CHANGED
data/delayed_job_groups.gemspec
CHANGED
@@ -17,15 +17,18 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.test_files = Dir.glob('spec/**/*')
|
18
18
|
spec.require_paths = ['lib']
|
19
19
|
|
20
|
+
spec.required_ruby_version = '>= 2.1'
|
21
|
+
|
20
22
|
spec.add_dependency 'delayed_job', '>= 4.1'
|
21
23
|
spec.add_dependency 'delayed_job_active_record', '>= 0.4'
|
22
24
|
|
23
25
|
spec.post_install_message = 'See https://github.com/salsify/delayed_job_groups_plugin#installation for upgrade/installation notes.'
|
24
26
|
|
25
|
-
spec.add_development_dependency 'activerecord', ENV.fetch('RAILS_VERSION', ['>= 3.2', '< 5.
|
27
|
+
spec.add_development_dependency 'activerecord', ENV.fetch('RAILS_VERSION', ['>= 3.2', '< 5.2'])
|
26
28
|
spec.add_development_dependency 'coveralls'
|
27
29
|
spec.add_development_dependency 'database_cleaner', '>= 1.2'
|
28
|
-
|
30
|
+
# rspec < 3.5 requires rake < 11.0
|
31
|
+
spec.add_development_dependency 'rake', '< 11.0'
|
29
32
|
spec.add_development_dependency 'rspec', '>= 2.14', '< 2.99'
|
30
33
|
spec.add_development_dependency 'simplecov', '~> 0.7.1'
|
31
34
|
spec.add_development_dependency 'timecop'
|
@@ -4,6 +4,11 @@ module Delayed
|
|
4
4
|
module JobGroups
|
5
5
|
module JobExtensions
|
6
6
|
extend ActiveSupport::Concern
|
7
|
+
module ReadyToRunExtension
|
8
|
+
def ready_to_run(worker_name, max_run_time)
|
9
|
+
super(worker_name, max_run_time).where(blocked: false)
|
10
|
+
end
|
11
|
+
end
|
7
12
|
|
8
13
|
included do
|
9
14
|
if Delayed::JobGroups::Compatibility.mass_assignment_security_enabled?
|
@@ -13,15 +18,9 @@ module Delayed
|
|
13
18
|
belongs_to :job_group, class_name: 'Delayed::JobGroups::JobGroup'
|
14
19
|
|
15
20
|
class << self
|
16
|
-
|
17
|
-
# Patch ready_to_run to exclude blocked jobs
|
18
|
-
def ready_to_run_with_blocked_filtering(worker_name, max_run_time)
|
19
|
-
ready_to_run_without_blocked_filtering(worker_name, max_run_time).where(blocked: false)
|
20
|
-
end
|
21
|
-
alias_method_chain :ready_to_run, :blocked_filtering
|
21
|
+
prepend ReadyToRunExtension
|
22
22
|
end
|
23
23
|
end
|
24
|
-
|
25
24
|
def in_job_group?
|
26
25
|
job_group_id.present?
|
27
26
|
end
|
@@ -19,7 +19,7 @@ module Delayed
|
|
19
19
|
validates :queueing_complete, :blocked, :failure_cancels_group, inclusion: [true, false]
|
20
20
|
|
21
21
|
if ActiveRecord::VERSION::MAJOR >= 4
|
22
|
-
has_many :active_jobs, -> { where(failed_at: nil) }, class_name: Job
|
22
|
+
has_many :active_jobs, -> { where(failed_at: nil) }, class_name: '::Delayed::Job'
|
23
23
|
else
|
24
24
|
has_many :active_jobs, class_name: Job, conditions: {failed_at: nil}
|
25
25
|
end
|
@@ -28,7 +28,7 @@ module Delayed
|
|
28
28
|
# Only delete dependent jobs that are unlocked so we can determine if there are in-flight jobs
|
29
29
|
# for canceled job groups
|
30
30
|
if ActiveRecord::VERSION::MAJOR >= 4
|
31
|
-
has_many :queued_jobs, -> { where(failed_at: nil, locked_by: nil) }, class_name: Job,
|
31
|
+
has_many :queued_jobs, -> { where(failed_at: nil, locked_by: nil) }, class_name: '::Delayed::Job',
|
32
32
|
dependent: :delete_all
|
33
33
|
else
|
34
34
|
has_many :queued_jobs, class_name: Job, conditions: {failed_at: nil, locked_by: nil},
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: delayed_job_groups_plugin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joel Turkel
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2017-10-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: delayed_job
|
@@ -48,7 +48,7 @@ dependencies:
|
|
48
48
|
version: '3.2'
|
49
49
|
- - "<"
|
50
50
|
- !ruby/object:Gem::Version
|
51
|
-
version: '5.
|
51
|
+
version: '5.2'
|
52
52
|
type: :development
|
53
53
|
prerelease: false
|
54
54
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -58,7 +58,7 @@ dependencies:
|
|
58
58
|
version: '3.2'
|
59
59
|
- - "<"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '5.
|
61
|
+
version: '5.2'
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
63
|
name: coveralls
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
@@ -91,16 +91,16 @@ dependencies:
|
|
91
91
|
name: rake
|
92
92
|
requirement: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - "
|
94
|
+
- - "<"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
96
|
+
version: '11.0'
|
97
97
|
type: :development
|
98
98
|
prerelease: false
|
99
99
|
version_requirements: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - "
|
101
|
+
- - "<"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '0'
|
103
|
+
version: '11.0'
|
104
104
|
- !ruby/object:Gem::Dependency
|
105
105
|
name: rspec
|
106
106
|
requirement: !ruby/object:Gem::Requirement
|
@@ -222,7 +222,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
222
222
|
requirements:
|
223
223
|
- - ">="
|
224
224
|
- !ruby/object:Gem::Version
|
225
|
-
version: '
|
225
|
+
version: '2.1'
|
226
226
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
227
227
|
requirements:
|
228
228
|
- - ">="
|
@@ -230,7 +230,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
230
230
|
version: '0'
|
231
231
|
requirements: []
|
232
232
|
rubyforge_project:
|
233
|
-
rubygems_version: 2.
|
233
|
+
rubygems_version: 2.6.12
|
234
234
|
signing_key:
|
235
235
|
specification_version: 4
|
236
236
|
summary: Delayed::Job job groups plugin
|