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:
quafzi committed 2026-08-28 23:15:24 +02:00
1 parent 5d409989df
commit 24ac738af0
2 files changed
+4 -3

No files matched your search

@@ -29,11 +29,12 @@
#++ #++
module Cron module Cron
class ClearOldGiteaPullRequestsJob < CronJob class ClearOldGiteaPullRequestsJob < ApplicationJob
self.cron_expression = "25 1 * * *" priority_number :low
def perform def perform
GiteaPullRequest.without_work_package.destroy_all GiteaPullRequest.without_work_package
.find_each(&:destroy!)
end end
end end
end end