class Citadel::MatrixInterceptor

Public Instance Methods

need_to_wait_and_retry(response) click to toggle source
# File lib/citadel/matrix_interceptor.rb, line 5
def need_to_wait_and_retry(response)
  wait_time = JSON.parse(response.body)['retry_after_ms']
  if wait_time
    sleep((wait_time / 1000).ceil + 1)
    return true
  else
    return false
  end
end