Archived
Fix cron job base class and migration version number
- ClearOldGiteaPullRequestsJob: inherit from ApplicationJob (not CronJob) and use find_each(&:destroy!) to match the GitHub/GitLab pattern - Rename aggregated migration from 1016015 to 1023015 to avoid collision with the recaptcha module migration
This commit is contained in:
1 parent
5d409989df
commit
24ac738af0
2 files changed
+4
-3
No files matched your search
@@ -29,11 +29,12 @@
|
||||
#++
|
||||
|
||||
module Cron
|
||||
class ClearOldGiteaPullRequestsJob < CronJob
|
||||
self.cron_expression = "25 1 * * *"
|
||||
class ClearOldGiteaPullRequestsJob < ApplicationJob
|
||||
priority_number :low
|
||||
|
||||
def perform
|
||||
GiteaPullRequest.without_work_package.destroy_all
|
||||
GiteaPullRequest.without_work_package
|
||||
.find_each(&:destroy!)
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user