Created
October 25, 2023 20:43
-
-
Save chasers/e4aa33625e6ea39ecb89f03383dd9e38 to your computer and use it in GitHub Desktop.
Finds DBConnection processes from Process.info
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Enum.each(Process.list, fn pid -> | |
case Process.info(pid)[:dictionary] do | |
[_, "$initial_call": {:supervisor, DBConnection.ConnectionPool.Pool, _}] -> | |
state = :sys.get_state(pid, 5000) | |
case elem(state, 11) do | |
{pid, _, Postgrex.Protocol, opts} -> | |
if opts[:hostname] == "db.REDACTED.supabase.co" do | |
IO.inspect({pid, state}) | |
end | |
_ -> nil | |
end | |
_ -> nil | |
end | |
end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment