Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

fix mailer config reload

Markus Kahl4ff17038f276
diff --git a/app/workers/application_job.rb b/app/workers/application_job.rb
index f3f3bc1da49..b31417293da 100644
--- a/app/workers/application_job.rb
+++ b/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