DEV: Initialize pg access log mutex in non-sidekiq processes

Followup to be3e4ab3f5
This commit is contained in:
David Taylor 2020-02-18 14:20:28 +00:00
parent 9441362c72
commit 2bdd1275ce
No known key found for this signature in database
GPG Key ID: 46904C18B1D3F434

View File

@ -24,10 +24,10 @@ if ENV["TRACE_PG_CONNECTIONS"]
FileUtils.mkdir_p(TRACE_DIR) FileUtils.mkdir_p(TRACE_DIR)
@trace_filename = "#{TRACE_DIR}/#{Process.pid}_#{self.object_id}.txt" @trace_filename = "#{TRACE_DIR}/#{Process.pid}_#{self.object_id}.txt"
trace File.new(@trace_filename, "w") trace File.new(@trace_filename, "w")
end
@access_log_mutex = Mutex.new @access_log_mutex = Mutex.new
@accessor_thread = nil @accessor_thread = nil
end end
end
def close def close
super.tap do super.tap do