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

Revert "Change syntax of gitlab engine to old cron syntax"

Oliver Günther2f7696f292dc
diff --git a/modules/gitlab_integration/app/workers/cron/clear_old_merge_requests_job.rb b/modules/gitlab_integration/app/workers/cron/clear_old_merge_requests_job.rb
index bfd79e16c5b..fa30113be3a 100644
--- a/modules/gitlab_integration/app/workers/cron/clear_old_merge_requests_job.rb
+++ b/modules/gitlab_integration/app/workers/cron/clear_old_merge_requests_job.rb
@@ -30,9 +30,7 @@
#++
module Cron
- class ClearOldMergeRequestsJob < CronJob
- self.cron_expression = '25 1 * * *' # runs at 1:25 nightly
-
+ class ClearOldMergeRequestsJob < ApplicationJob
priority_number :low
def perform
diff --git a/modules/gitlab_integration/lib/open_project/gitlab_integration/engine.rb b/modules/gitlab_integration/lib/open_project/gitlab_integration/engine.rb
index 68520a33b8c..71cdbf7e2fb 100644
--- a/modules/gitlab_integration/lib/open_project/gitlab_integration/engine.rb
+++ b/modules/gitlab_integration/lib/open_project/gitlab_integration/engine.rb
@@ -100,6 +100,13 @@ module OpenProject::GitlabIntegration
mount ::API::V3::GitlabIssues::GitlabIssuesByWorkPackageAPI
end
- add_cron_jobs { ::Cron::ClearOldMergeRequestsJob }
+ add_cron_jobs do
+ {
+ 'Cron::ClearOldMergeRequestsJob': {
+ cron: '25 1 * * *', # runs at 1:25 nightly
+ class: ::Cron::ClearOldMergeRequestsJob.name
+ }
+ }
+ end
end
end