Skip to content

Commit

Permalink
Revert "fix[Op#53019]: Good Job ClearOldMergeRequestsJob"
Browse files Browse the repository at this point in the history
This reverts commit a5eb528.
  • Loading branch information
Eric-Guo committed Mar 26, 2024
1 parent 1391fb9 commit 17182e4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,12 @@
#++

module Cron
class ClearOldMergeRequestsJob < ApplicationJob
class ClearOldMergeRequestsJob < CronJob
priority_number :low

# runs at 1:25 nightly
self.cron_expression = "25 1 * * *"

def perform
GitlabMergeRequest.without_work_package
.find_each(&:destroy!)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,9 @@ class Engine < ::Rails::Engine
mount ::API::V3::GitlabIssues::GitlabIssuesByWorkPackageAPI
end

add_cron_jobs do
{
"Cron::ClearOldMergeRequestsJob": {
cron: "25 1 * * *", # runs at 1:25 nightly
class: ::Cron::ClearOldMergeRequestsJob.name
}
}
config.to_prepare do
# Register the cron job to clean up old gitlab merge requests
::Cron::CronJob.register! ::Cron::ClearOldMergeRequestsJob
end
end
end

0 comments on commit 17182e4

Please sign in to comment.