Skip to content

Commit

Permalink
don't require active_record_query_trace unless needed
Browse files Browse the repository at this point in the history
Change-Id: Ia7bfd5ccf72cef364e912b399ee514568697ad14
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279024
Reviewed-by: Andrea Cirulli <[email protected]>
Reviewed-by: Cody Cutrer <[email protected]>
QA-Review: Cody Cutrer <[email protected]>
Product-Review: Cody Cutrer <[email protected]>
Tested-by: Service Cloud Jenkins <[email protected]>
  • Loading branch information
jstanley0 committed Nov 20, 2021
1 parent d665b7a commit 4287654
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config/initializers/active_record_query_trace.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.

require 'active_record_query_trace'

module ARQueryTraceInitializer
VALID_QUERY_TYPES = %i[all read write].freeze
VALID_LEVELS = %i[app rails full].freeze
Expand All @@ -27,6 +25,8 @@ def self.configure!
return if Rails.env.production?
return unless Canvas::Plugin.value_to_boolean(ENV['AR_QUERY_TRACE'])

require 'active_record_query_trace'

lines_in_trace = ENV['AR_QUERY_TRACE_LINES'].to_i
query_types = ENV['AR_QUERY_TRACE_TYPE']&.to_sym
level = ENV['AR_QUERY_TRACE_LEVEL']&.to_sym
Expand Down

0 comments on commit 4287654

Please sign in to comment.