heroku_dj_auto_scale 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/heroku_dj_auto_scale.rb +7 -3
- data/lib/heroku_dj_auto_scale/version.rb +1 -1
- metadata +1 -1
data/lib/heroku_dj_auto_scale.rb
CHANGED
@@ -19,7 +19,7 @@ module HerokuDjAutoScale
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
-
def
|
22
|
+
def workers
|
23
23
|
if ENV['USE_HEROKU_SCALING'] == 'true'
|
24
24
|
if stack == "cedar"
|
25
25
|
heroku.ps(ENV['HEROKU_APP']).count { |p| p["process"] =~ /worker\.\d?/ }
|
@@ -58,16 +58,20 @@ module HerokuDjAutoScale
|
|
58
58
|
|
59
59
|
def enqueue(*args)
|
60
60
|
[
|
61
|
+
{
|
62
|
+
:workers => 0, # This many workers
|
63
|
+
:job_count => 0 # For this many jobs or more, until the next level
|
64
|
+
},
|
61
65
|
{
|
62
66
|
:workers => 1, # This many workers
|
63
67
|
:job_count => 1 # For this many jobs or more, until the next level
|
64
68
|
},
|
65
69
|
{
|
66
|
-
:workers =>
|
70
|
+
:workers => 2,
|
67
71
|
:job_count => 400
|
68
72
|
},
|
69
73
|
{
|
70
|
-
:workers =>
|
74
|
+
:workers => 3,
|
71
75
|
:job_count => 2500
|
72
76
|
}
|
73
77
|
].reverse_each do |scale_info|
|