Commit b027a6ef authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab-ce master

parents 4c1262ff 57cba4d1
......@@ -9,7 +9,7 @@ module Projects
end
def execute
Projects::HousekeepingService.new(@project).execute do
Projects::HousekeepingService.new(@project, :gc).execute do
repository.delete_all_refs_except(RESERVED_REF_PREFIXES)
end
rescue Projects::HousekeepingService::LeaseTaken => e
......
......@@ -18,8 +18,9 @@ module Projects
end
end
def initialize(project)
def initialize(project, task = nil)
@project = project
@task = task
end
def execute
......@@ -69,6 +70,8 @@ module Projects
end
def task
return @task if @task
if pushes_since_gc % gc_period == 0
:gc
elsif pushes_since_gc % full_repack_period == 0
......
---
title: Force a full GC after importing a project
merge_request: 26803
author:
type: performance
......@@ -13,7 +13,7 @@ describe Projects::AfterImportService do
describe '#execute' do
before do
allow(Projects::HousekeepingService)
.to receive(:new).with(project).and_return(housekeeping_service)
.to receive(:new).with(project, :gc).and_return(housekeeping_service)
allow(housekeeping_service)
.to receive(:execute).and_yield
......
......@@ -88,6 +88,19 @@ describe Projects::HousekeepingService do
expect(project.pushes_since_gc).to eq(1)
end
end
it 'runs the task specifically requested' do
housekeeping = described_class.new(project, :gc)
allow(housekeeping).to receive(:try_obtain_lease).and_return(:gc_uuid)
allow(housekeeping).to receive(:lease_key).and_return(:gc_lease_key)
expect(GitGarbageCollectWorker).to receive(:perform_async).with(project.id, :gc, :gc_lease_key, :gc_uuid).twice
2.times do
housekeeping.execute
end
end
end
describe '#needed?' do
......
# frozen_string_literal: true
require 'spec_helper'
describe AdminEmailWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe ArchiveTraceWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe AuthorizedProjectsWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe BackgroundMigrationWorker, :sidekiq, :clean_gitlab_redis_shared_state do
......
# frozen_string_literal: true
require 'spec_helper'
describe BuildCoverageWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe BuildFinishedWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe BuildHooksWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe BuildSuccessWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe BuildTraceSectionsWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe Ci::ArchiveTracesCronWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe Ci::BuildScheduleWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe ClusterProvisionWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe ClusterWaitForIngressIpAddressWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe ApplicationWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe ClusterQueue do
......
# frozen_string_literal: true
require 'spec_helper'
describe CronjobQueue do
......
# frozen_string_literal: true
require 'spec_helper'
describe Gitlab::GithubImport::NotifyUponDeath do
......
# frozen_string_literal: true
require 'spec_helper'
describe Gitlab::GithubImport::ObjectImporter do
......
# frozen_string_literal: true
require 'spec_helper'
describe Gitlab::GithubImport::Queue do
......
# frozen_string_literal: true
require 'spec_helper'
describe Gitlab::GithubImport::ReschedulingMethods do
......
# frozen_string_literal: true
require 'spec_helper'
describe Gitlab::GithubImport::StageMethods do
......
# frozen_string_literal: true
require 'spec_helper'
describe PipelineBackgroundQueue do
......
# frozen_string_literal: true
require 'spec_helper'
describe PipelineQueue do
......
# frozen_string_literal: true
require 'spec_helper'
describe ProjectImportOptions do
......
# frozen_string_literal: true
require 'spec_helper'
describe RepositoryCheckQueue do
......
# frozen_string_literal: true
require 'spec_helper'
describe WaitableWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe CreateGpgSignatureWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe CreateNoteDiffFileWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe CreatePipelineWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe DeleteDiffFilesWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe DeleteMergedBranchesWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe DeleteUserWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe Deployments::SuccessWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe DetectRepositoryLanguagesWorker do
......
# frozen_string_literal: true
require "spec_helper"
describe EmailReceiverWorker, :mailer do
......
# frozen_string_literal: true
require 'spec_helper'
describe EmailsOnPushWorker, :mailer do
......
# frozen_string_literal: true
require 'spec_helper'
describe 'Every Sidekiq worker' do
......
# frozen_string_literal: true
require 'spec_helper'
describe ExpireBuildArtifactsWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe ExpireBuildInstanceArtifactsWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe ExpireJobCacheWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe ExpirePipelineCacheWorker do
......
# frozen_string_literal: true
require 'fileutils'
require 'spec_helper'
......
# frozen_string_literal: true
require 'spec_helper'
describe Gitlab::GithubImport::AdvanceStageWorker, :clean_gitlab_redis_shared_state do
......
# frozen_string_literal: true
require 'spec_helper'
describe Gitlab::GithubImport::ImportDiffNoteWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe Gitlab::GithubImport::ImportIssueWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe Gitlab::GithubImport::ImportNoteWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe Gitlab::GithubImport::ImportPullRequestWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe Gitlab::GithubImport::RefreshImportJidWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe Gitlab::GithubImport::Stage::FinishImportWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe Gitlab::GithubImport::Stage::ImportBaseDataWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe Gitlab::GithubImport::Stage::ImportIssuesAndDiffNotesWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe Gitlab::GithubImport::Stage::ImportLfsObjectsWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe Gitlab::GithubImport::Stage::ImportNotesWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe Gitlab::GithubImport::Stage::ImportPullRequestsWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe Gitlab::GithubImport::Stage::ImportRepositoryWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe GitlabShellWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe GitlabUsagePingWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe GroupDestroyWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe HashedStorage::MigratorWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe HashedStorage::ProjectMigrateWorker, :clean_gitlab_redis_shared_state do
......
# frozen_string_literal: true
require 'spec_helper'
describe InvalidGpgSignatureUpdateWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe IssueDueSchedulerWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe MailScheduler::IssueDueWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe MailScheduler::NotificationServiceWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe MergeWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe NamespacelessProjectDestroyWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe NewIssueWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe NewMergeRequestWorker do
......
# frozen_string_literal: true
require "spec_helper"
describe NewNoteWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe PagesDomainVerificationCronWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe PagesDomainVerificationWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe PipelineHooksWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe PipelineMetricsWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe PipelineNotificationWorker, :mailer do
......
# frozen_string_literal: true
require 'spec_helper'
describe PipelineProcessWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe PipelineScheduleWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe PipelineSuccessWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe PipelineUpdateWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe PluginWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe PostReceive do
......
# frozen_string_literal: true
require 'spec_helper'
describe ProcessCommitWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe ProjectCacheWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe ProjectDestroyWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe ProjectExportWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe PropagateServiceTemplateWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe PruneOldEventsWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe PruneWebHookLogsWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe ReactiveCachingWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe RebaseWorker, '#perform' do
......
# frozen_string_literal: true
require 'spec_helper'
describe RemoteMirrorNotificationWorker, :mailer do
......
# frozen_string_literal: true
require 'spec_helper'
describe RemoveExpiredGroupLinksWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe RemoveExpiredMembersWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe RemoveUnreferencedLfsObjectsWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe RepositoryCheck::BatchWorker do
......
# frozen_string_literal: true
require 'spec_helper'
describe RepositoryCheck::ClearWorker do
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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