Method: Pwrake::IdleCores#decrease
- Defined in:
- lib/pwrake/master/idle_cores.rb
#decrease(k, n) ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/pwrake/master/idle_cores.rb', line 12 def decrease(k,n) x = (self[k]||0) - n if x == 0 delete(k) elsif x < 0 raise "# of cores must be non-negative" else self[k] = x end end |