move the instance_eval(&block) to the bottom, so state gets refreshed at least once ... stale state == bad

This commit is contained in:
Edward Muller 2010-05-01 05:56:31 +08:00 committed by Wesley Beary
parent 035ead02c0
commit 4ca08fea11
1 changed files with 2 additions and 5 deletions

View File

@ -111,13 +111,10 @@ module Fog
def wait_for(timeout = 600, &block)
start = Time.now
until instance_eval(&block)
if Time.now - start > timeout
break
end
begin
reload
sleep(1)
end
end until instance_eval(&block) || Time.now - start > timeout
end
private