Commit 8e1be747 authored by Oswaldo Ferreira's avatar Oswaldo Ferreira

Merge branch '212645-deleted-projects-does-not-get-deleted' into 'master'

Remove spacing interval between soft deleted projects

See merge request gitlab-org/gitlab!35046
parents 6fcfee0b bd4a01c9
......@@ -4,7 +4,7 @@ class AdjournedProjectsDeletionCronWorker # rubocop:disable Scalability/Idempote
include ApplicationWorker
include CronjobQueue
INTERVAL = 5.minutes.to_i
INTERVAL = 10.seconds.to_i
feature_category :authentication_and_authorization
......
---
title: Remove spacing interval between soft deleted projects
merge_request: 35046
author:
type: fixed
......@@ -6,8 +6,8 @@ RSpec.describe AdjournedProjectsDeletionCronWorker do
describe "#perform" do
subject(:worker) { described_class.new }
let(:user) { create(:user)}
let(:marked_for_deletion_at) { 14.days.ago }
let_it_be(:user) { create(:user)}
let_it_be(:marked_for_deletion_at) { 14.days.ago }
let!(:project_marked_for_deletion) { create(:project, marked_for_deletion_at: marked_for_deletion_at, deleting_user: user) }
before do
......@@ -21,6 +21,17 @@ RSpec.describe AdjournedProjectsDeletionCronWorker do
worker.perform
end
context 'when two projects are scheduled for deletion' do
let_it_be(:project_marked_for_deletion_two) { create(:project, marked_for_deletion_at: marked_for_deletion_at, deleting_user: user) }
it 'schedules the second job 10 seconds after the first' do
expect(AdjournedProjectDeletionWorker).to receive(:perform_in).with(10, project_marked_for_deletion.id)
expect(AdjournedProjectDeletionWorker).to receive(:perform_in).with(0, project_marked_for_deletion_two.id)
worker.perform
end
end
context 'marked for deletion exectly before number of days from settings' do
let(:marked_for_deletion_at) { 7.days.ago }
......
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