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
19
spec/jobs/cron/expired_users_deletion_job_spec.rb
Normal file
19
spec/jobs/cron/expired_users_deletion_job_spec.rb
Normal file
|
@ -0,0 +1,19 @@
|
|||
describe Cron::ExpiredUsersDeletionJob do
|
||||
subject { described_class.perform_now }
|
||||
|
||||
context 'when env[EXPIRE_USER_DELETION_JOB_DISABLED] is present' do
|
||||
before { expect(ENV).to receive(:[]).with('EXPIRE_USER_DELETION_JOB_DISABLED').and_return('anything') }
|
||||
|
||||
it 'does not call ExpiredUsersDeletionService.process_expired' do
|
||||
expect(ExpiredUsersDeletionService).not_to receive(:process_expired)
|
||||
subject
|
||||
end
|
||||
end
|
||||
|
||||
context 'when env[EXPIRE_USER_DELETION_JOB_DISABLED] is absent' do
|
||||
it 'calls ExpiredUsersDeletionService.process_expired' do
|
||||
expect(ExpiredUsersDeletionService).to receive(:process_expired)
|
||||
subject
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue