def fetch_remote_tables_info
retries = 0
max_retries = 10
begin
tables = OkJson.decode(session_resource['pull/table_names'].get(http_headers).to_s)
rescue RestClient::Exception
retries += 1
retry if retries <= max_retries
puts "Unable to fetch tables information from #{remote_url}. Please check the server log."
exit(1)
end
data = {}
apply_table_filter(tables).each do |table_name|
retries = 0
begin
count = session_resource['pull/table_count'].post({:table => table_name}, http_headers).to_s.to_i
data[table_name] = count
rescue RestClient::Exception
retries += 1
retry if retries <= max_retries
puts "Unable to fetch tables information from #{remote_url}. Please check the server log."
exit(1)
end
end
data
end