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

Ensure we re-enable rake tasks after invokation in job

Oliver Günther636abf54fa99
diff --git a/app/workers/rake_job.rb b/app/workers/rake_job.rb
index d157fc1de34..fc0e936f1da 100644
--- a/app/workers/rake_job.rb
+++ b/app/workers/rake_job.rb
@@ -29,7 +29,7 @@ require 'rake'
##
# Invoke a rake task while safely loading the tasks only once
-# to ensure they are neither loaded nor executed twice.
+# to ensure they are only loaded once.
module RakeJob
attr_reader :task_name, :args
@@ -46,6 +46,8 @@ module RakeJob
def invoke
load_tasks!
task.invoke *args
+ ensure
+ task&.reenable
end
##