lib/rbbt/util/misc/development.rb in rbbt-util-5.34.11 vs lib/rbbt/util/misc/development.rb in rbbt-util-5.34.12
- old
+ new
@@ -411,6 +411,17 @@
Log.debug "Run ssh script in #{server}:\n#{script}"
CMD.cmd("ssh '#{server}' 'shopt -s expand_aliases; bash -l -c \"ruby\"' ", :in => script, :log => true).read
end
+ def self.timeout_insist(time, msg = nil, &block)
+ Misc.insist do
+ begin
+ Timeout.timeout(time, TryAgain, msg, &block)
+ rescue TryAgain
+ Log.low "Timeout detected after #{time} seconds"
+ raise $!
+ end
+ end
+ end
+
end