fix mailer config reload

It wasn't reloaded because
the SMTP settings were still cached in the
request store which only was reset afterwards
pull/9623/head
Markus Kahl 3 years ago
parent 9f4d14f866
commit 4ff17038f2
  1. 15
      app/workers/application_job.rb

@ -36,10 +36,7 @@ class ApplicationJob < ::ActiveJob::Base
# to avoid leaking sensitive information to logs
self.log_arguments = false
around_perform do |_job, block|
reload_mailer_configuration!
with_clean_request_store { block.call }
end
around_perform :clean_context
##
# Return a priority number on the given payload
@ -90,4 +87,14 @@ class ApplicationJob < ::ActiveJob::Base
def reload_mailer_configuration!
OpenProject::Configuration.reload_mailer_configuration!
end
private
def clean_context
with_clean_request_store do
reload_mailer_configuration!
yield
end
end
end

Loading…
Cancel
Save