mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 10:08:40 -05:00
Move pool-checks into a function
This commit is contained in:
parent
29ad2b9e09
commit
8aab996666
1 changed files with 9 additions and 3 deletions
|
|
@ -170,9 +170,7 @@ def destroy_vm vm, pool
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def check_pool pool
|
||||||
|
|
||||||
pools.each do |pool|
|
|
||||||
puts "Starting new worker thread for pool '#{pool['name']}'"
|
puts "Starting new worker thread for pool '#{pool['name']}'"
|
||||||
|
|
||||||
Thread.new {
|
Thread.new {
|
||||||
|
|
@ -251,6 +249,14 @@ pools.each do |pool|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
pools.each do |pool|
|
||||||
|
check_pool(pool)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
loop do
|
loop do
|
||||||
sleep(1)
|
sleep(1)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue