Commit 92aa3881 authored by Nick Thomas's avatar Nick Thomas

Merge branch '5197-geo-don-t-attempt-to-expire-the-cache-after-a-failed-clone' into 'master'

Resolve "Geo: Don't attempt to expire the cache after a failed clone"

Closes #5197

See merge request gitlab-org/gitlab-ee!4940
parents 9acc13f5 fa1d6ec2
......@@ -18,7 +18,7 @@ module EE
# Runs code after a repository has been synced.
def after_sync
expire_all_method_caches
expire_branch_cache
expire_branch_cache if exists?
expire_content_cache
end
......
---
title: 'Fix ''Geo: Don''t attempt to expire the cache after a failed clone'''
merge_request:
author:
type: fixed
require 'spec_helper'
describe Repository do
include RepoHelpers
TestBlob = Struct.new(:path)
let(:project) { create(:project, :repository) }
let(:repository) { project.repository }
describe '#after_sync' do
it 'expires repository cache' do
expect(repository).to receive(:expire_all_method_caches)
expect(repository).to receive(:expire_branch_cache)
expect(repository).to receive(:expire_content_cache)
repository.after_sync
end
it 'does not call expire_branch_cache if repository does not exist' do
allow(repository).to receive(:exists?).and_return(false)
expect(repository).to receive(:expire_all_method_caches)
expect(repository).not_to receive(:expire_branch_cache)
expect(repository).to receive(:expire_content_cache)
repository.after_sync
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