tech(expires-user.cron): ajoute une tache cron [débrayable] pour faire tourner la tache de suppression des usagers inutile
attention, pour notre instance, avec ma db anonymiser : ``` ExpiredUsersDeletionService.find_expired_user.pluck(:id).size => 1795515 ```
This commit is contained in:
parent
a49a5c2c93
commit
252b3e4719
3 changed files with 31 additions and 1 deletions
8
app/jobs/cron/expired_users_deletion_job.rb
Normal file
8
app/jobs/cron/expired_users_deletion_job.rb
Normal file
|
@ -0,0 +1,8 @@
|
|||
class Cron::ExpiredUsersDeletionJob < Cron::CronJob
|
||||
self.schedule_expression = "every day at 11 pm"
|
||||
|
||||
def perform(*args)
|
||||
return if ENV['EXPIRE_USER_DELETION_JOB_DISABLED'].present?
|
||||
ExpiredUsersDeletionService.process_expired
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue