diff --git a/web/app/controllers/api_users_controller.rb b/web/app/controllers/api_users_controller.rb index 26fce0bd7..93c0d9ef1 100644 --- a/web/app/controllers/api_users_controller.rb +++ b/web/app/controllers/api_users_controller.rb @@ -942,16 +942,26 @@ class ApiUsersController < ApiController url = URI(latency_url) begin http = Net::HTTP.new(url.host, url.port) - http.use_ssl = true if Rails.env.production? + http.use_ssl = true if Rails.application.config.latency_data_host.start_with?("https://") request = Net::HTTP::Get.new(url) request["Authorization"] = "Basic #{Rails.application.config.latency_data_host_auth_code}" response = http.request(request) if response.is_a?(Net::HTTPOK) || response.is_a?(Net::HTTPSuccess) render json: response.body, status: 200 else + Bugsnag.notify(exception) do |report| + report.severity = "warning" + report.add_tab(:latency, { + user_id: current_user.id, + name: current_user.name, + user_ids: params[:user_ids], + url: latency_url + }) + end render json: {}, status: 422 end rescue + Bugsnag.notify("Latency server returned code: #{response.code}") render json: {}, status: 500 end end diff --git a/web/config/environments/development.rb b/web/config/environments/development.rb index 03cdf4e60..478424b43 100644 --- a/web/config/environments/development.rb +++ b/web/config/environments/development.rb @@ -1,4 +1,3 @@ -gcp_stats_host def audiomixer_workspace_path if ENV['WORKSPACE'] dev_path = ENV['WORKSPACE']