class ApplicationController < ActionController::Base MAX_DURATION_TO_COMPLETE_IN_SECONDS = 3 around_action do |_, action| logger.measure_error "Took too long to complete, please review your code as asynchronous task", min_duration: MAX_DURATION_TO_COMPLETE_IN_SECONDS * 1000 do action.call end end end