canvas-jobs 0.10.2 → 0.10.3

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
  SHA1:
3
- metadata.gz: 5f0f7a704ab25af4fe3265b40f88d83915892cdf
4
- data.tar.gz: 2d7d88d8ace4f4b37bb5e89b8c0974fe21c592d0
3
+ metadata.gz: aeda81334fe194eb27996d982198016d7c4dd9a1
4
+ data.tar.gz: c4698165803dc0ca24530a335e031d2f71725e69
5
5
  SHA512:
6
- metadata.gz: d0c954cee81c2f914c820599e592e8357990077d8056bf9e4abff12f352d8f97842c55ac33ef88c85f3fac11162603ef9191d6c8096e1861f5eec9fd62f09175
7
- data.tar.gz: d0962185edbdebcb17926563d2cf335107ed2fb72553fa581f6fe2fa75ea9251b8adf3b321f8ecd11c476bb612d3416dc987044386cfdcbba0f41c6483fdf681
6
+ metadata.gz: d543d4c884dd14f0084091d6942247d4e6816a5f6d3e31d8ac2c1bb612aecc7402ff1759136dd70eb0e874120b3539218de3e6fbf8c82ba5210a9c613f388e95
7
+ data.tar.gz: 0299d21693a0e48dfba4f56d7ca93d79c2355880637608650776012aa1a34047a322d0b47e8cd84e16afcb385ed39fa0c5b8a890f27535f803a1fe0848239b5d
@@ -0,0 +1,50 @@
1
+ class ImproveMaxConcurrent < ActiveRecord::Migration
2
+ def connection
3
+ Delayed::Job.connection
4
+ end
5
+
6
+ def up
7
+ if connection.adapter_name == 'PostgreSQL'
8
+ execute(<<-CODE)
9
+ CREATE OR REPLACE FUNCTION delayed_jobs_after_delete_row_tr_fn () RETURNS trigger AS $$
10
+ DECLARE
11
+ running_count integer;
12
+ BEGIN
13
+ IF OLD.strand IS NOT NULL THEN
14
+ PERFORM pg_advisory_xact_lock(half_md5_as_bigint(OLD.strand));
15
+ running_count := (SELECT COUNT(*) FROM delayed_jobs WHERE strand = OLD.strand AND next_in_strand = 't');
16
+ IF running_count < OLD.max_concurrent THEN
17
+ UPDATE delayed_jobs SET next_in_strand = 't' WHERE id IN (
18
+ SELECT id FROM delayed_jobs j2 WHERE next_in_strand = 'f' AND
19
+ j2.strand = OLD.strand ORDER BY j2.id ASC LIMIT (OLD.max_concurrent - running_count) FOR UPDATE
20
+ );
21
+ END IF;
22
+ END IF;
23
+ RETURN OLD;
24
+ END;
25
+ $$ LANGUAGE plpgsql;
26
+ CODE
27
+ end
28
+ end
29
+
30
+ def down
31
+ if connection.adapter_name == 'PostgreSQL'
32
+ execute(<<-CODE)
33
+ CREATE OR REPLACE FUNCTION delayed_jobs_after_delete_row_tr_fn () RETURNS trigger AS $$
34
+ BEGIN
35
+ IF OLD.strand IS NOT NULL THEN
36
+ PERFORM pg_advisory_xact_lock(half_md5_as_bigint(OLD.strand));
37
+ IF (SELECT COUNT(*) FROM delayed_jobs WHERE strand = OLD.strand AND next_in_strand = 't') < OLD.max_concurrent THEN
38
+ UPDATE delayed_jobs SET next_in_strand = 't' WHERE id = (
39
+ SELECT id FROM delayed_jobs j2 WHERE next_in_strand = 'f' AND
40
+ j2.strand = OLD.strand ORDER BY j2.id ASC LIMIT 1 FOR UPDATE
41
+ );
42
+ END IF;
43
+ END IF;
44
+ RETURN OLD;
45
+ END;
46
+ $$ LANGUAGE plpgsql;
47
+ CODE
48
+ end
49
+ end
50
+ end
@@ -301,7 +301,7 @@ module Delayed
301
301
  handler = nil
302
302
  begin
303
303
  handler = _yaml_deserialize(source)
304
- rescue TypeError
304
+ rescue TypeError, ArgumentError
305
305
  attempt_to_load_from_source(source)
306
306
  handler = _yaml_deserialize(source)
307
307
  end
@@ -1,3 +1,3 @@
1
1
  module Delayed
2
- VERSION = "0.10.2"
2
+ VERSION = "0.10.3"
3
3
  end
@@ -1,16 +1,20 @@
1
1
  # New definitions for YAML to aid in serialization and deserialization of delayed jobs.
2
2
 
3
3
  require 'yaml'
4
- require 'syck'
5
- # this code needs to be updated to work with the new Psych YAML engine in ruby 1.9.x
6
- # for now we force Syck
7
- YAML::ENGINE.yamler = 'syck' if defined?(YAML::ENGINE) && YAML::ENGINE.yamler != 'syck'
8
4
 
9
5
  # First, tell YAML how to load a Module. This depends on Rails .constantize and autoloading.
10
6
  YAML.add_ruby_type("object:Module") do |type, val|
11
7
  val.constantize
12
8
  end
13
9
 
10
+ Psych.add_domain_type("ruby/object", "Module") do |type, val|
11
+ val.constantize
12
+ end
13
+
14
+ Psych.add_domain_type("ruby/object", "Class") do |type, val|
15
+ val.constantize
16
+ end
17
+
14
18
  class Module
15
19
  def to_yaml(opts = {})
16
20
  YAML.quick_emit(self.object_id, opts) do |out|
@@ -30,6 +34,10 @@ class Class
30
34
  out.scalar(taguri, name)
31
35
  end
32
36
  end
37
+
38
+ def encode_with(coder)
39
+ coder.scalar("!ruby/object:Class", name)
40
+ end
33
41
  end
34
42
 
35
43
  # Now, tell YAML how to intelligently load ActiveRecord objects, using the
@@ -47,6 +55,13 @@ class ActiveRecord::Base
47
55
  end
48
56
  end
49
57
 
58
+ def encode_with(coder)
59
+ if id.nil?
60
+ raise("Can't serialize unsaved ActiveRecord object for delayed job: #{self.inspect}")
61
+ end
62
+ coder.scalar("!ruby/ActiveRecord:#{self.class.name}", id.to_s)
63
+ end
64
+
50
65
  def self.yaml_new(klass, tag, val)
51
66
  klass.find(val)
52
67
  rescue ActiveRecord::RecordNotFound
@@ -54,6 +69,37 @@ class ActiveRecord::Base
54
69
  end
55
70
  end
56
71
 
72
+ module Delayed
73
+ module PsychExt
74
+ module ToRuby
75
+ def visit_Psych_Nodes_Scalar(object)
76
+ case object.tag
77
+ when %r{^!ruby/ActiveRecord:(.+)$}
78
+ begin
79
+ klass = resolve_class(Regexp.last_match[1])
80
+ klass.unscoped.find(object.value)
81
+ rescue ActiveRecord::RecordNotFound
82
+ raise Delayed::Backend::RecordNotFound, "Couldn't find #{klass} with id #{object.value.inspect}"
83
+ end
84
+ when "tag:ruby.yaml.org,2002:Delayed::Periodic"
85
+ Delayed::Periodic.scheduled[object.value] || raise(NameError, "job #{object.value} is no longer scheduled")
86
+ else
87
+ super
88
+ end
89
+ end
90
+
91
+ def resolve_class(klass_name)
92
+ return nil if !klass_name || klass_name.empty?
93
+ klass_name.constantize
94
+ rescue
95
+ super
96
+ end
97
+ end
98
+ end
99
+ end
100
+
101
+ Psych::Visitors::ToRuby.prepend(Delayed::PsychExt::ToRuby)
102
+
57
103
  # Load Module/Class from yaml tag.
58
104
  class Module
59
105
  def yaml_tag_read_class(name)
@@ -180,7 +180,7 @@ describe 'Delayed::Backed::ActiveRecord::Job' do
180
180
  job2.next_in_strand.should == true
181
181
  end
182
182
 
183
- it "should run set multiple jobs as next_in_strand at a time based on max_concurrent" do
183
+ it "should set multiple jobs as next_in_strand at a time based on max_concurrent" do
184
184
  change_setting(Delayed::Settings, :num_strands, ->(strand_name) {
185
185
  case strand_name
186
186
  when "njobs"; 2
@@ -201,6 +201,40 @@ describe 'Delayed::Backed::ActiveRecord::Job' do
201
201
  job3.next_in_strand.should == true
202
202
  end
203
203
  end
204
+
205
+ it "should set multiple jobs as next_in_strand at once if needed" do
206
+ change_setting(Delayed::Settings, :num_strands, ->(strand_name) {
207
+ case strand_name
208
+ when "njobs"; 2
209
+ else nil
210
+ end
211
+ }) do
212
+ job1 = Delayed::Job.enqueue(SimpleJob.new, n_strand: ["njobs"])
213
+ job1.reload
214
+ job1.next_in_strand.should == true
215
+ job2 = Delayed::Job.enqueue(SimpleJob.new, n_strand: ["njobs"])
216
+ job2.reload
217
+ job2.next_in_strand.should == true
218
+
219
+ job3 = Delayed::Job.enqueue(SimpleJob.new, n_strand: ["njobs"])
220
+ job3.reload
221
+ job3.next_in_strand.should == false
222
+
223
+ # manually unset next_in_strand
224
+ Delayed::Job.where(:id => job2).update_all(:next_in_strand => false)
225
+ job2.reload
226
+ job2.next_in_strand.should == false
227
+
228
+ run_job(job1) # should update both jobs
229
+
230
+ job3.reload
231
+ job3.next_in_strand.should == true
232
+
233
+ job2.reload
234
+ job2.next_in_strand.should == true
235
+
236
+ end
237
+ end
204
238
  end
205
239
  end
206
240
  end
@@ -4,6 +4,3 @@ gemspec :path=>"../../"
4
4
 
5
5
  gem "rails", "~> 3.2.19"
6
6
 
7
- platforms :ruby_20, :ruby_21, :ruby_22 do
8
- gem 'syck', '>= 1.0.4'
9
- end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../../
3
3
  specs:
4
- canvas-jobs (0.9.14)
4
+ canvas-jobs (0.10.1)
5
5
  after_transaction_commit (= 1.0.1)
6
6
  rails (>= 3.2)
7
7
  redis (> 3.0)
@@ -11,12 +11,12 @@ PATH
11
11
  GEM
12
12
  remote: https://rubygems.org/
13
13
  specs:
14
- actionmailer (3.2.22)
15
- actionpack (= 3.2.22)
14
+ actionmailer (3.2.19)
15
+ actionpack (= 3.2.19)
16
16
  mail (~> 2.5.4)
17
- actionpack (3.2.22)
18
- activemodel (= 3.2.22)
19
- activesupport (= 3.2.22)
17
+ actionpack (3.2.19)
18
+ activemodel (= 3.2.19)
19
+ activesupport (= 3.2.19)
20
20
  builder (~> 3.0.0)
21
21
  erubis (~> 2.7.0)
22
22
  journey (~> 1.0.4)
@@ -24,72 +24,72 @@ GEM
24
24
  rack-cache (~> 1.2)
25
25
  rack-test (~> 0.6.1)
26
26
  sprockets (~> 2.2.1)
27
- activemodel (3.2.22)
28
- activesupport (= 3.2.22)
27
+ activemodel (3.2.19)
28
+ activesupport (= 3.2.19)
29
29
  builder (~> 3.0.0)
30
- activerecord (3.2.22)
31
- activemodel (= 3.2.22)
32
- activesupport (= 3.2.22)
30
+ activerecord (3.2.19)
31
+ activemodel (= 3.2.19)
32
+ activesupport (= 3.2.19)
33
33
  arel (~> 3.0.2)
34
34
  tzinfo (~> 0.3.29)
35
- activeresource (3.2.22)
36
- activemodel (= 3.2.22)
37
- activesupport (= 3.2.22)
38
- activesupport (3.2.22)
35
+ activeresource (3.2.19)
36
+ activemodel (= 3.2.19)
37
+ activesupport (= 3.2.19)
38
+ activesupport (3.2.19)
39
39
  i18n (~> 0.6, >= 0.6.4)
40
40
  multi_json (~> 1.0)
41
41
  after_transaction_commit (1.0.1)
42
42
  activerecord (>= 3.2)
43
43
  arel (3.0.3)
44
44
  backports (3.6.6)
45
- builder (3.0.4)
46
- bump (0.5.2)
45
+ builder (3.0.0)
46
+ bump (0.5.0)
47
47
  coderay (1.1.0)
48
48
  database_cleaner (1.3.0)
49
49
  diff-lcs (1.2.5)
50
50
  erubis (2.7.0)
51
51
  hike (1.2.3)
52
- i18n (0.7.0)
52
+ i18n (0.6.11)
53
53
  journey (1.0.4)
54
- json (1.8.3)
54
+ json (1.8.1)
55
55
  mail (2.5.4)
56
56
  mime-types (~> 1.16)
57
57
  treetop (~> 1.4.8)
58
58
  method_source (0.8.2)
59
59
  mime-types (1.25.1)
60
- multi_json (1.11.2)
61
- pg (0.18.2)
60
+ multi_json (1.10.1)
61
+ pg (0.17.1)
62
62
  polyglot (0.3.5)
63
63
  pry (0.10.1)
64
64
  coderay (~> 1.1.0)
65
65
  method_source (~> 0.8.1)
66
66
  slop (~> 3.4)
67
- rack (1.4.7)
67
+ rack (1.4.5)
68
68
  rack-cache (1.2)
69
69
  rack (>= 0.4)
70
70
  rack-protection (1.5.3)
71
71
  rack
72
72
  rack-ssl (1.3.4)
73
73
  rack
74
- rack-test (0.6.3)
74
+ rack-test (0.6.2)
75
75
  rack (>= 1.0)
76
- rails (3.2.22)
77
- actionmailer (= 3.2.22)
78
- actionpack (= 3.2.22)
79
- activerecord (= 3.2.22)
80
- activeresource (= 3.2.22)
81
- activesupport (= 3.2.22)
76
+ rails (3.2.19)
77
+ actionmailer (= 3.2.19)
78
+ actionpack (= 3.2.19)
79
+ activerecord (= 3.2.19)
80
+ activeresource (= 3.2.19)
81
+ activesupport (= 3.2.19)
82
82
  bundler (~> 1.0)
83
- railties (= 3.2.22)
84
- railties (3.2.22)
85
- actionpack (= 3.2.22)
86
- activesupport (= 3.2.22)
83
+ railties (= 3.2.19)
84
+ railties (3.2.19)
85
+ actionpack (= 3.2.19)
86
+ activesupport (= 3.2.19)
87
87
  rack-ssl (~> 1.3.2)
88
88
  rake (>= 0.8.7)
89
89
  rdoc (~> 3.4)
90
90
  thor (>= 0.14.6, < 2.0)
91
- rake (10.4.2)
92
- rdoc (3.12.2)
91
+ rake (10.3.2)
92
+ rdoc (3.12)
93
93
  json (~> 1.4)
94
94
  redis (3.2.1)
95
95
  redis-scripting (1.0.1)
@@ -106,7 +106,7 @@ GEM
106
106
  rspec-mocks (3.1.3)
107
107
  rspec-support (~> 3.1.0)
108
108
  rspec-support (3.1.2)
109
- rufus-scheduler (3.1.3)
109
+ rufus-scheduler (3.1.7)
110
110
  sinatra (1.4.6)
111
111
  rack (~> 1.4)
112
112
  rack-protection (~> 1.4)
@@ -119,11 +119,12 @@ GEM
119
119
  sinatra (~> 1.4.0)
120
120
  tilt (>= 1.3, < 3)
121
121
  slop (3.6.0)
122
- sprockets (2.2.3)
122
+ sprockets (2.2.2)
123
123
  hike (~> 1.2)
124
124
  multi_json (~> 1.0)
125
125
  rack (~> 1.0)
126
126
  tilt (~> 1.1, != 1.3.0)
127
+ syck (1.0.5)
127
128
  test_after_commit (0.4.1)
128
129
  activerecord (>= 3.2)
129
130
  thor (0.19.1)
@@ -132,8 +133,8 @@ GEM
132
133
  treetop (1.4.15)
133
134
  polyglot
134
135
  polyglot (>= 0.3.1)
135
- tzinfo (0.3.44)
136
- wwtd (0.7.0)
136
+ tzinfo (0.3.39)
137
+ wwtd (1.1.1)
137
138
 
138
139
  PLATFORMS
139
140
  ruby
@@ -150,6 +151,7 @@ DEPENDENCIES
150
151
  rspec (= 3.1.0)
151
152
  sinatra
152
153
  sinatra-contrib
154
+ syck (>= 1.0.4)
153
155
  test_after_commit (= 0.4.1)
154
156
  timecop (= 0.7.1)
155
- wwtd (= 0.7.0)
157
+ wwtd (~> 1.1.1)
@@ -5,5 +5,5 @@ gemspec :path=>"../../"
5
5
  gem "rails", "~> 4.0.10"
6
6
 
7
7
  platforms :ruby_20, :ruby_21, :ruby_22 do
8
- gem 'syck', '>= 1.0.4'
8
+ gem 'byebug'
9
9
  end
@@ -0,0 +1,146 @@
1
+ PATH
2
+ remote: ../../
3
+ specs:
4
+ canvas-jobs (0.10.1)
5
+ after_transaction_commit (= 1.0.1)
6
+ rails (>= 3.2)
7
+ redis (> 3.0)
8
+ redis-scripting (~> 1.0.1)
9
+ rufus-scheduler (~> 3.1.2)
10
+
11
+ GEM
12
+ remote: https://rubygems.org/
13
+ specs:
14
+ actionmailer (4.0.13)
15
+ actionpack (= 4.0.13)
16
+ mail (~> 2.5, >= 2.5.4)
17
+ actionpack (4.0.13)
18
+ activesupport (= 4.0.13)
19
+ builder (~> 3.1.0)
20
+ erubis (~> 2.7.0)
21
+ rack (~> 1.5.2)
22
+ rack-test (~> 0.6.2)
23
+ activemodel (4.0.13)
24
+ activesupport (= 4.0.13)
25
+ builder (~> 3.1.0)
26
+ activerecord (4.0.13)
27
+ activemodel (= 4.0.13)
28
+ activerecord-deprecated_finders (~> 1.0.2)
29
+ activesupport (= 4.0.13)
30
+ arel (~> 4.0.0)
31
+ activerecord-deprecated_finders (1.0.4)
32
+ activesupport (4.0.13)
33
+ i18n (~> 0.6, >= 0.6.9)
34
+ minitest (~> 4.2)
35
+ multi_json (~> 1.3)
36
+ thread_safe (~> 0.1)
37
+ tzinfo (~> 0.3.37)
38
+ after_transaction_commit (1.0.1)
39
+ activerecord (>= 3.2)
40
+ arel (4.0.2)
41
+ backports (3.6.6)
42
+ builder (3.1.4)
43
+ bump (0.5.2)
44
+ byebug (8.2.1)
45
+ coderay (1.1.0)
46
+ database_cleaner (1.3.0)
47
+ diff-lcs (1.2.5)
48
+ erubis (2.7.0)
49
+ i18n (0.7.0)
50
+ mail (2.6.3)
51
+ mime-types (>= 1.16, < 3)
52
+ method_source (0.8.2)
53
+ mime-types (2.6.2)
54
+ minitest (4.7.5)
55
+ multi_json (1.11.2)
56
+ pg (0.18.3)
57
+ pry (0.10.3)
58
+ coderay (~> 1.1.0)
59
+ method_source (~> 0.8.1)
60
+ slop (~> 3.4)
61
+ rack (1.5.5)
62
+ rack-protection (1.5.3)
63
+ rack
64
+ rack-test (0.6.3)
65
+ rack (>= 1.0)
66
+ rails (4.0.13)
67
+ actionmailer (= 4.0.13)
68
+ actionpack (= 4.0.13)
69
+ activerecord (= 4.0.13)
70
+ activesupport (= 4.0.13)
71
+ bundler (>= 1.3.0, < 2.0)
72
+ railties (= 4.0.13)
73
+ sprockets-rails (~> 2.0)
74
+ railties (4.0.13)
75
+ actionpack (= 4.0.13)
76
+ activesupport (= 4.0.13)
77
+ rake (>= 0.8.7)
78
+ thor (>= 0.18.1, < 2.0)
79
+ rake (10.4.2)
80
+ redis (3.2.1)
81
+ redis-scripting (1.0.1)
82
+ redis (>= 3.0)
83
+ rspec (3.1.0)
84
+ rspec-core (~> 3.1.0)
85
+ rspec-expectations (~> 3.1.0)
86
+ rspec-mocks (~> 3.1.0)
87
+ rspec-core (3.1.7)
88
+ rspec-support (~> 3.1.0)
89
+ rspec-expectations (3.1.2)
90
+ diff-lcs (>= 1.2.0, < 2.0)
91
+ rspec-support (~> 3.1.0)
92
+ rspec-mocks (3.1.3)
93
+ rspec-support (~> 3.1.0)
94
+ rspec-support (3.1.2)
95
+ rufus-scheduler (3.1.7)
96
+ sinatra (1.4.6)
97
+ rack (~> 1.4)
98
+ rack-protection (~> 1.4)
99
+ tilt (>= 1.3, < 3)
100
+ sinatra-contrib (1.4.6)
101
+ backports (>= 2.0)
102
+ multi_json
103
+ rack-protection
104
+ rack-test
105
+ sinatra (~> 1.4.0)
106
+ tilt (>= 1.3, < 3)
107
+ slop (3.6.0)
108
+ sprockets (3.4.0)
109
+ rack (> 1, < 3)
110
+ sprockets-rails (2.3.3)
111
+ actionpack (>= 3.0)
112
+ activesupport (>= 3.0)
113
+ sprockets (>= 2.8, < 4.0)
114
+ syck (1.0.5)
115
+ test_after_commit (0.4.1)
116
+ activerecord (>= 3.2)
117
+ thor (0.19.1)
118
+ thread_safe (0.3.5)
119
+ tilt (2.0.1)
120
+ timecop (0.7.1)
121
+ tzinfo (0.3.45)
122
+ wwtd (1.1.1)
123
+
124
+ PLATFORMS
125
+ ruby
126
+
127
+ DEPENDENCIES
128
+ bump
129
+ byebug
130
+ canvas-jobs!
131
+ database_cleaner (= 1.3.0)
132
+ pg
133
+ pry
134
+ rack-test
135
+ rails (~> 4.0.10)
136
+ rake
137
+ rspec (= 3.1.0)
138
+ sinatra
139
+ sinatra-contrib
140
+ syck
141
+ test_after_commit (= 0.4.1)
142
+ timecop (= 0.7.1)
143
+ wwtd (~> 1.1.1)
144
+
145
+ BUNDLED WITH
146
+ 1.10.6
@@ -3,7 +3,3 @@ source "https://rubygems.org"
3
3
  gemspec :path=>"../../"
4
4
 
5
5
  gem "rails", "~> 4.1.6"
6
-
7
- platforms :ruby_20, :ruby_21, :ruby_22 do
8
- gem 'syck', '>= 1.0.4'
9
- end
@@ -0,0 +1,147 @@
1
+ PATH
2
+ remote: ../../
3
+ specs:
4
+ canvas-jobs (0.9.15)
5
+ after_transaction_commit (= 1.0.1)
6
+ rails (>= 3.2)
7
+ redis (> 3.0)
8
+ redis-scripting (~> 1.0.1)
9
+ rufus-scheduler (~> 3.1.2)
10
+
11
+ GEM
12
+ remote: https://rubygems.org/
13
+ specs:
14
+ actionmailer (4.1.13)
15
+ actionpack (= 4.1.13)
16
+ actionview (= 4.1.13)
17
+ mail (~> 2.5, >= 2.5.4)
18
+ actionpack (4.1.13)
19
+ actionview (= 4.1.13)
20
+ activesupport (= 4.1.13)
21
+ rack (~> 1.5.2)
22
+ rack-test (~> 0.6.2)
23
+ actionview (4.1.13)
24
+ activesupport (= 4.1.13)
25
+ builder (~> 3.1)
26
+ erubis (~> 2.7.0)
27
+ activemodel (4.1.13)
28
+ activesupport (= 4.1.13)
29
+ builder (~> 3.1)
30
+ activerecord (4.1.13)
31
+ activemodel (= 4.1.13)
32
+ activesupport (= 4.1.13)
33
+ arel (~> 5.0.0)
34
+ activesupport (4.1.13)
35
+ i18n (~> 0.6, >= 0.6.9)
36
+ json (~> 1.7, >= 1.7.7)
37
+ minitest (~> 5.1)
38
+ thread_safe (~> 0.1)
39
+ tzinfo (~> 1.1)
40
+ after_transaction_commit (1.0.1)
41
+ activerecord (>= 3.2)
42
+ arel (5.0.1.20140414130214)
43
+ backports (3.6.6)
44
+ builder (3.2.2)
45
+ bump (0.5.2)
46
+ coderay (1.1.0)
47
+ database_cleaner (1.3.0)
48
+ diff-lcs (1.2.5)
49
+ erubis (2.7.0)
50
+ i18n (0.7.0)
51
+ json (1.8.3)
52
+ mail (2.6.3)
53
+ mime-types (>= 1.16, < 3)
54
+ method_source (0.8.2)
55
+ mime-types (2.6.2)
56
+ minitest (5.8.1)
57
+ multi_json (1.11.2)
58
+ pg (0.18.3)
59
+ pry (0.10.3)
60
+ coderay (~> 1.1.0)
61
+ method_source (~> 0.8.1)
62
+ slop (~> 3.4)
63
+ rack (1.5.5)
64
+ rack-protection (1.5.3)
65
+ rack
66
+ rack-test (0.6.3)
67
+ rack (>= 1.0)
68
+ rails (4.1.13)
69
+ actionmailer (= 4.1.13)
70
+ actionpack (= 4.1.13)
71
+ actionview (= 4.1.13)
72
+ activemodel (= 4.1.13)
73
+ activerecord (= 4.1.13)
74
+ activesupport (= 4.1.13)
75
+ bundler (>= 1.3.0, < 2.0)
76
+ railties (= 4.1.13)
77
+ sprockets-rails (~> 2.0)
78
+ railties (4.1.13)
79
+ actionpack (= 4.1.13)
80
+ activesupport (= 4.1.13)
81
+ rake (>= 0.8.7)
82
+ thor (>= 0.18.1, < 2.0)
83
+ rake (10.4.2)
84
+ redis (3.2.1)
85
+ redis-scripting (1.0.1)
86
+ redis (>= 3.0)
87
+ rspec (3.1.0)
88
+ rspec-core (~> 3.1.0)
89
+ rspec-expectations (~> 3.1.0)
90
+ rspec-mocks (~> 3.1.0)
91
+ rspec-core (3.1.7)
92
+ rspec-support (~> 3.1.0)
93
+ rspec-expectations (3.1.2)
94
+ diff-lcs (>= 1.2.0, < 2.0)
95
+ rspec-support (~> 3.1.0)
96
+ rspec-mocks (3.1.3)
97
+ rspec-support (~> 3.1.0)
98
+ rspec-support (3.1.2)
99
+ rufus-scheduler (3.1.7)
100
+ sinatra (1.4.6)
101
+ rack (~> 1.4)
102
+ rack-protection (~> 1.4)
103
+ tilt (>= 1.3, < 3)
104
+ sinatra-contrib (1.4.6)
105
+ backports (>= 2.0)
106
+ multi_json
107
+ rack-protection
108
+ rack-test
109
+ sinatra (~> 1.4.0)
110
+ tilt (>= 1.3, < 3)
111
+ slop (3.6.0)
112
+ sprockets (3.4.0)
113
+ rack (> 1, < 3)
114
+ sprockets-rails (2.3.3)
115
+ actionpack (>= 3.0)
116
+ activesupport (>= 3.0)
117
+ sprockets (>= 2.8, < 4.0)
118
+ syck (1.0.5)
119
+ test_after_commit (0.4.1)
120
+ activerecord (>= 3.2)
121
+ thor (0.19.1)
122
+ thread_safe (0.3.5)
123
+ tilt (2.0.1)
124
+ timecop (0.7.1)
125
+ tzinfo (1.2.2)
126
+ thread_safe (~> 0.1)
127
+ wwtd (1.1.1)
128
+
129
+ PLATFORMS
130
+ ruby
131
+
132
+ DEPENDENCIES
133
+ bump
134
+ canvas-jobs!
135
+ database_cleaner (= 1.3.0)
136
+ pg
137
+ pry
138
+ rack-test
139
+ rails (~> 4.1.6)
140
+ rake
141
+ rspec (= 3.1.0)
142
+ sinatra
143
+ sinatra-contrib
144
+ syck (>= 1.0.4)
145
+ test_after_commit (= 0.4.1)
146
+ timecop (= 0.7.1)
147
+ wwtd (~> 1.1.1)
@@ -3,7 +3,3 @@ source "https://rubygems.org"
3
3
  gemspec :path=>"../../"
4
4
 
5
5
  gem "rails", "~> 4.2.0.beta2"
6
-
7
- platforms :ruby_20, :ruby_21, :ruby_22 do
8
- gem 'syck', '>= 1.0.4'
9
- end
@@ -0,0 +1,172 @@
1
+ PATH
2
+ remote: ../../
3
+ specs:
4
+ canvas-jobs (0.9.15)
5
+ after_transaction_commit (= 1.0.1)
6
+ rails (>= 3.2)
7
+ redis (> 3.0)
8
+ redis-scripting (~> 1.0.1)
9
+ rufus-scheduler (~> 3.1.2)
10
+
11
+ GEM
12
+ remote: https://rubygems.org/
13
+ specs:
14
+ actionmailer (4.2.4)
15
+ actionpack (= 4.2.4)
16
+ actionview (= 4.2.4)
17
+ activejob (= 4.2.4)
18
+ mail (~> 2.5, >= 2.5.4)
19
+ rails-dom-testing (~> 1.0, >= 1.0.5)
20
+ actionpack (4.2.4)
21
+ actionview (= 4.2.4)
22
+ activesupport (= 4.2.4)
23
+ rack (~> 1.6)
24
+ rack-test (~> 0.6.2)
25
+ rails-dom-testing (~> 1.0, >= 1.0.5)
26
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
27
+ actionview (4.2.4)
28
+ activesupport (= 4.2.4)
29
+ builder (~> 3.1)
30
+ erubis (~> 2.7.0)
31
+ rails-dom-testing (~> 1.0, >= 1.0.5)
32
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
33
+ activejob (4.2.4)
34
+ activesupport (= 4.2.4)
35
+ globalid (>= 0.3.0)
36
+ activemodel (4.2.4)
37
+ activesupport (= 4.2.4)
38
+ builder (~> 3.1)
39
+ activerecord (4.2.4)
40
+ activemodel (= 4.2.4)
41
+ activesupport (= 4.2.4)
42
+ arel (~> 6.0)
43
+ activesupport (4.2.4)
44
+ i18n (~> 0.7)
45
+ json (~> 1.7, >= 1.7.7)
46
+ minitest (~> 5.1)
47
+ thread_safe (~> 0.3, >= 0.3.4)
48
+ tzinfo (~> 1.1)
49
+ after_transaction_commit (1.0.1)
50
+ activerecord (>= 3.2)
51
+ arel (6.0.3)
52
+ backports (3.6.6)
53
+ builder (3.2.2)
54
+ bump (0.5.2)
55
+ coderay (1.1.0)
56
+ database_cleaner (1.3.0)
57
+ diff-lcs (1.2.5)
58
+ erubis (2.7.0)
59
+ globalid (0.3.6)
60
+ activesupport (>= 4.1.0)
61
+ i18n (0.7.0)
62
+ json (1.8.3)
63
+ loofah (2.0.3)
64
+ nokogiri (>= 1.5.9)
65
+ mail (2.6.3)
66
+ mime-types (>= 1.16, < 3)
67
+ method_source (0.8.2)
68
+ mime-types (2.6.2)
69
+ mini_portile (0.6.2)
70
+ minitest (5.8.1)
71
+ multi_json (1.11.2)
72
+ nokogiri (1.6.6.2)
73
+ mini_portile (~> 0.6.0)
74
+ pg (0.18.3)
75
+ pry (0.10.3)
76
+ coderay (~> 1.1.0)
77
+ method_source (~> 0.8.1)
78
+ slop (~> 3.4)
79
+ rack (1.6.4)
80
+ rack-protection (1.5.3)
81
+ rack
82
+ rack-test (0.6.3)
83
+ rack (>= 1.0)
84
+ rails (4.2.4)
85
+ actionmailer (= 4.2.4)
86
+ actionpack (= 4.2.4)
87
+ actionview (= 4.2.4)
88
+ activejob (= 4.2.4)
89
+ activemodel (= 4.2.4)
90
+ activerecord (= 4.2.4)
91
+ activesupport (= 4.2.4)
92
+ bundler (>= 1.3.0, < 2.0)
93
+ railties (= 4.2.4)
94
+ sprockets-rails
95
+ rails-deprecated_sanitizer (1.0.3)
96
+ activesupport (>= 4.2.0.alpha)
97
+ rails-dom-testing (1.0.7)
98
+ activesupport (>= 4.2.0.beta, < 5.0)
99
+ nokogiri (~> 1.6.0)
100
+ rails-deprecated_sanitizer (>= 1.0.1)
101
+ rails-html-sanitizer (1.0.2)
102
+ loofah (~> 2.0)
103
+ railties (4.2.4)
104
+ actionpack (= 4.2.4)
105
+ activesupport (= 4.2.4)
106
+ rake (>= 0.8.7)
107
+ thor (>= 0.18.1, < 2.0)
108
+ rake (10.4.2)
109
+ redis (3.2.1)
110
+ redis-scripting (1.0.1)
111
+ redis (>= 3.0)
112
+ rspec (3.1.0)
113
+ rspec-core (~> 3.1.0)
114
+ rspec-expectations (~> 3.1.0)
115
+ rspec-mocks (~> 3.1.0)
116
+ rspec-core (3.1.7)
117
+ rspec-support (~> 3.1.0)
118
+ rspec-expectations (3.1.2)
119
+ diff-lcs (>= 1.2.0, < 2.0)
120
+ rspec-support (~> 3.1.0)
121
+ rspec-mocks (3.1.3)
122
+ rspec-support (~> 3.1.0)
123
+ rspec-support (3.1.2)
124
+ rufus-scheduler (3.1.7)
125
+ sinatra (1.4.6)
126
+ rack (~> 1.4)
127
+ rack-protection (~> 1.4)
128
+ tilt (>= 1.3, < 3)
129
+ sinatra-contrib (1.4.6)
130
+ backports (>= 2.0)
131
+ multi_json
132
+ rack-protection
133
+ rack-test
134
+ sinatra (~> 1.4.0)
135
+ tilt (>= 1.3, < 3)
136
+ slop (3.6.0)
137
+ sprockets (3.4.0)
138
+ rack (> 1, < 3)
139
+ sprockets-rails (2.3.3)
140
+ actionpack (>= 3.0)
141
+ activesupport (>= 3.0)
142
+ sprockets (>= 2.8, < 4.0)
143
+ syck (1.0.5)
144
+ test_after_commit (0.4.1)
145
+ activerecord (>= 3.2)
146
+ thor (0.19.1)
147
+ thread_safe (0.3.5)
148
+ tilt (2.0.1)
149
+ timecop (0.7.1)
150
+ tzinfo (1.2.2)
151
+ thread_safe (~> 0.1)
152
+ wwtd (1.1.1)
153
+
154
+ PLATFORMS
155
+ ruby
156
+
157
+ DEPENDENCIES
158
+ bump
159
+ canvas-jobs!
160
+ database_cleaner (= 1.3.0)
161
+ pg
162
+ pry
163
+ rack-test
164
+ rails (~> 4.2.0.beta2)
165
+ rake
166
+ rspec (= 3.1.0)
167
+ sinatra
168
+ sinatra-contrib
169
+ syck (>= 1.0.4)
170
+ test_after_commit (= 0.4.1)
171
+ timecop (= 0.7.1)
172
+ wwtd (~> 1.1.1)
@@ -22,6 +22,7 @@ shared_examples_for 'Delayed::Testing' do
22
22
  describe '.drain' do
23
23
  it 'should run all queued jobs' do
24
24
  3.times { TestingWorker.send_later(:run) }
25
+ YAML.dump(TestingWorker)
25
26
  Delayed::Testing.drain
26
27
  expect(TestingWorker.runs).to eq 3
27
28
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: canvas-jobs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.2
4
+ version: 0.10.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Luetke
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-12-09 00:00:00.000000000 Z
12
+ date: 2015-12-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: after_transaction_commit
@@ -277,6 +277,7 @@ files:
277
277
  - db/migrate/20140512213941_add_source_to_jobs.rb
278
278
  - db/migrate/20150807133223_add_max_concurrent_to_jobs.rb
279
279
  - db/migrate/20151123210429_add_expires_at_to_jobs.rb
280
+ - db/migrate/20151210162949_improve_max_concurrent.rb
280
281
  - lib/canvas-jobs.rb
281
282
  - lib/delayed/backend/active_record.rb
282
283
  - lib/delayed/backend/base.rb
@@ -319,8 +320,11 @@ files:
319
320
  - spec/gemfiles/32.gemfile
320
321
  - spec/gemfiles/32.gemfile.lock
321
322
  - spec/gemfiles/40.gemfile
323
+ - spec/gemfiles/40.gemfile.lock
322
324
  - spec/gemfiles/41.gemfile
325
+ - spec/gemfiles/41.gemfile.lock
323
326
  - spec/gemfiles/42.gemfile
327
+ - spec/gemfiles/42.gemfile.lock
324
328
  - spec/migrate/20140924140513_add_story_table.rb
325
329
  - spec/redis_job_spec.rb
326
330
  - spec/sample_jobs.rb
@@ -343,7 +347,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
343
347
  requirements:
344
348
  - - ">="
345
349
  - !ruby/object:Gem::Version
346
- version: '0'
350
+ version: '2.0'
347
351
  required_rubygems_version: !ruby/object:Gem::Requirement
348
352
  requirements:
349
353
  - - ">="
@@ -351,7 +355,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
351
355
  version: '0'
352
356
  requirements: []
353
357
  rubyforge_project:
354
- rubygems_version: 2.4.7
358
+ rubygems_version: 2.4.5.1
355
359
  signing_key:
356
360
  specification_version: 4
357
361
  summary: Instructure-maintained fork of delayed_job
@@ -363,8 +367,11 @@ test_files:
363
367
  - spec/gemfiles/32.gemfile
364
368
  - spec/gemfiles/32.gemfile.lock
365
369
  - spec/gemfiles/40.gemfile
370
+ - spec/gemfiles/40.gemfile.lock
366
371
  - spec/gemfiles/41.gemfile
372
+ - spec/gemfiles/41.gemfile.lock
367
373
  - spec/gemfiles/42.gemfile
374
+ - spec/gemfiles/42.gemfile.lock
368
375
  - spec/migrate/20140924140513_add_story_table.rb
369
376
  - spec/redis_job_spec.rb
370
377
  - spec/sample_jobs.rb