Add some logs to connection_worker to help debug race

pull/974/head
Connor Rigby 2018-11-19 12:05:18 -08:00
parent 0d32bdfccf
commit bfa1b7f966
No known key found for this signature in database
GPG Key ID: 29A88B24B70456E0
1 changed files with 2 additions and 2 deletions

View File

@ -27,10 +27,10 @@ defmodule Farmbot.AMQP.ConnectionWorker do
{:ok, conn}
end
def terminate(_, conn) do
def terminate(reason, conn) do
if Process.alive?(conn.pid) do
try do
Logger.info("Closing AMQP connection.")
Logger.info("Closing AMQP connection: #{inspect(reason)}")
:ok = AMQP.Connection.close(conn)
rescue
ex ->