workless 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +4 -3
- data/lib/workless/scaler.rb +7 -7
- metadata +1 -1
data/README.md
CHANGED
@@ -9,6 +9,7 @@ By adding the gem to your project and configuring our Heroku app with some confi
|
|
9
9
|
|
10
10
|
## Updates
|
11
11
|
|
12
|
+
* Version 1.1.1 includes a fix from @filiptepper and @fixr to correctly scale workers
|
12
13
|
* Version 1.1.0 has been released, this adds support for scaling using multiple workers thanks to @jaimeiniesta and @davidakachaos.
|
13
14
|
* Version 1.0.0 has been released, this brings compatibility with delayed_job 3 and compatibility with Rails 2.3.x and up.
|
14
15
|
|
@@ -30,21 +31,21 @@ Add the workless gem and the delayed_job gem to your project Gemfile and update
|
|
30
31
|
|
31
32
|
<pre>
|
32
33
|
gem "delayed_job", "2.0.7"
|
33
|
-
gem "workless", "~> 1.
|
34
|
+
gem "workless", "~> 1.1.1"
|
34
35
|
</pre>
|
35
36
|
|
36
37
|
### For rails 3.x with delayed_job 2.1.x
|
37
38
|
|
38
39
|
<pre>
|
39
40
|
gem "delayed_job", "~> 2.1.4"
|
40
|
-
gem "workless", "~> 1.
|
41
|
+
gem "workless", "~> 1.1.1"
|
41
42
|
</pre>
|
42
43
|
|
43
44
|
### For rails 3.x with latest delayed_job 3.x using active record
|
44
45
|
|
45
46
|
<pre>
|
46
47
|
gem "delayed_job_active_record"
|
47
|
-
gem "workless", "~> 1.
|
48
|
+
gem "workless", "~> 1.1.1"
|
48
49
|
</pre>
|
49
50
|
|
50
51
|
If you don't specify delayed_job in your Gemfile workless will bring it in, most likly the latest version (3.0.1)
|
data/lib/workless/scaler.rb
CHANGED
@@ -4,19 +4,19 @@ require 'workless/scalers/local'
|
|
4
4
|
require 'workless/scalers/null'
|
5
5
|
|
6
6
|
module Delayed
|
7
|
-
module Workless
|
7
|
+
module Workless
|
8
8
|
module Scaler
|
9
|
-
|
9
|
+
|
10
10
|
def self.included(base)
|
11
11
|
base.send :extend, ClassMethods
|
12
12
|
base.class_eval do
|
13
13
|
after_destroy "self.class.scaler.down"
|
14
|
-
|
14
|
+
after_create "self.class.scaler.up"
|
15
15
|
after_update "self.class.scaler.down", :unless => Proc.new {|r| r.failed_at.nil? }
|
16
16
|
end
|
17
|
-
|
17
|
+
|
18
18
|
end
|
19
|
-
|
19
|
+
|
20
20
|
module ClassMethods
|
21
21
|
def scaler
|
22
22
|
@scaler ||= if ENV.include?("HEROKU_API_KEY")
|
@@ -30,8 +30,8 @@ module Delayed
|
|
30
30
|
@scaler = "Delayed::Workless::Scaler::#{scaler.to_s.camelize}".constantize
|
31
31
|
end
|
32
32
|
end
|
33
|
-
|
33
|
+
|
34
34
|
end
|
35
|
-
|
35
|
+
|
36
36
|
end
|
37
37
|
end
|