DEV: Add optional support for running byebug when a PG Clash happens

Tracking down concurrency issues from backtraces and manual repros is a fraught process.
Sometimes you've just got to get your hands dirty and do a live debug.
This commit is contained in:
Matt Palmer 2020-02-19 12:50:26 +11:00
parent 9f8a27a132
commit a14a7f1cb8

View File

@ -50,6 +50,11 @@ if ENV["TRACE_PG_CONNECTIONS"]
#{Thread.current&.backtrace&.join("\n")}
STRING
if ENV["ON_PG_CLASH"] == "byebug"
require "byebug"
byebug
end
end
@accessor_thread = Thread.current
end