You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

9 lines
323 B

2 years ago
2 years ago
  1. class ApplicationController < ActionController::Base
  2. MAX_DURATION_TO_COMPLETE_IN_SECONDS = 3
  3. around_action do |_, action|
  4. 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
  5. action.call
  6. end
  7. end
  8. end