Merge pull request #293 from mattkirby/do_not_discover_destroying

Remove VM from completed only after destroy
This commit is contained in:
mattkirby 2018-07-24 16:33:16 -07:00 committed by GitHub
commit 0a769b8901
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -298,7 +298,6 @@ module Vmpooler
mutex = vm_mutex(vm)
return if mutex.locked?
mutex.synchronize do
$redis.srem('vmpooler__completed__' + pool, vm)
$redis.hdel('vmpooler__active__' + pool, vm)
$redis.hset('vmpooler__vm__' + vm, 'destroy', Time.now)
@ -309,6 +308,8 @@ module Vmpooler
provider.destroy_vm(pool, vm)
$redis.srem('vmpooler__completed__' + pool, vm)
finish = format('%.2f', Time.now - start)
$logger.log('s', "[-] [#{pool}] '#{vm}' destroyed in #{finish} seconds")
$metrics.timing("destroy.#{pool}", finish)