A platform for community discussion. Free, open, simple.
DEV: Add more debugging context to onebox generation
Sam Saffron906ec87d2605
diff --git a/app/controllers/onebox_controller.rb b/app/controllers/onebox_controller.rbindex f656ba34146..dfa81c5e80a 100644--- a/app/controllers/onebox_controller.rb+++ b/app/controllers/onebox_controller.rb@@ -21,7 +21,7 @@ class OneboxController < ApplicationControllerreturn render(body: nil, status: 404) if Oneboxer.recently_failed?(url)- hijack do+ hijack(info: "#{url} topic_id: #{topic_id} user_id: #{user_id}") doOneboxer.preview_onebox!(user_id)preview = Oneboxer.preview(url,diff --git a/lib/hijack.rb b/lib/hijack.rbindex 1cf6d0dc3f7..0b39abb7103 100644--- a/lib/hijack.rb+++ b/lib/hijack.rb@@ -7,7 +7,7 @@ require 'method_profiler'# free up a unicorn worker while the remote IO is happeningmodule Hijack- def hijack(&blk)+ def hijack(info: nil, &blk)controller_class = self.classif hijack = request.env['rack.hijack']@@ -31,7 +31,7 @@ module Hijack# on the way down the stackoriginal_headers = response.headers.dup- Scheduler::Defer.later("hijack #{params["controller"]} #{params["action"]}") do+ Scheduler::Defer.later("hijack #{params["controller"]} #{params["action"]} #{info}") doMethodProfiler.start(transfer_timings)begin