Class: Delayed::Workless::Scaler::Heroku
Class Method Summary
collapse
client
Methods inherited from Base
calculate_num_workers, jobs, num_workers_cache, num_workers_cache=, scale_info=
Class Method Details
.down ⇒ Object
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/workless/scalers/heroku.rb', line 22
def self.down
nw = self.calculate_num_workers
if nw
if self.num_workers_cache != nw
self.num_workers_cache = nw
client.set_workers(ENV['APP_NAME'], nw)
end
end
rescue
end
|
.up ⇒ Object
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/workless/scalers/heroku.rb', line 11
def self.up
nw = self.calculate_num_workers(true)
if nw
if self.num_workers_cache != nw
self.num_workers_cache = nw
client.set_workers(ENV['APP_NAME'], nw)
end
end
rescue
end
|
.workers ⇒ Object
33
34
35
|
# File 'lib/workless/scalers/heroku.rb', line 33
def self.workers
client.info(ENV['APP_NAME'])[:workers].to_i
end
|