Module: Voicemeeter::Util::Timeout
- Included in:
- Base
- Defined in:
- lib/voicemeeter/util.rb
Instance Method Summary collapse
Instance Method Details
#login ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/voicemeeter/util.rb', line 22 def login super err = nil start = Time.now begin sleep 0.1 logger.info "Successfully logged into #{self} version #{version}" logger.debug "login time: #{(Time.now - start).round(2)}" err = nil rescue Errors::VMCAPIError => e err = e retry if Time.now < start + @login_timeout end raise Errors::VMError.new "Timeout logging into the api" if err clear_dirty end |