Commit 655a39d6 authored by Imre Farkas's avatar Imre Farkas

Merge branch '250275-group_adjourned_worker_delay_interval' into 'master'

Shorten spacing interval between deleted groups

See merge request gitlab-org/gitlab!42585
parents 152b0cd9 70289eea
...@@ -4,7 +4,7 @@ class AdjournedGroupDeletionWorker # rubocop:disable Scalability/IdempotentWorke ...@@ -4,7 +4,7 @@ class AdjournedGroupDeletionWorker # rubocop:disable Scalability/IdempotentWorke
include ApplicationWorker include ApplicationWorker
include CronjobQueue include CronjobQueue
INTERVAL = 5.minutes.to_i INTERVAL = 10.seconds.to_i
feature_category :authentication_and_authorization feature_category :authentication_and_authorization
......
...@@ -42,5 +42,16 @@ RSpec.describe AdjournedGroupDeletionWorker do ...@@ -42,5 +42,16 @@ RSpec.describe AdjournedGroupDeletionWorker do
worker.perform worker.perform
end end
it 'schedules groups 10 seconds apart' do
group_marked_for_deletion_2 = create(:group_with_deletion_schedule,
marked_for_deletion_on: 14.days.ago,
deleting_user: user)
expect(GroupDestroyWorker).to receive(:perform_in).with(0, group_marked_for_deletion.id, user.id)
expect(GroupDestroyWorker).to receive(:perform_in).with(10, group_marked_for_deletion_2.id, user.id)
worker.perform
end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment