Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
c724049e
Commit
c724049e
authored
Jan 05, 2017
by
Sean McGivern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expire caches on Geo repo fetch
parent
26315637
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
app/workers/geo_repository_fetch_worker.rb
app/workers/geo_repository_fetch_worker.rb
+3
-0
spec/workers/geo_repository_fetch_worker_spec.rb
spec/workers/geo_repository_fetch_worker_spec.rb
+12
-0
No files found.
app/workers/geo_repository_fetch_worker.rb
View file @
c724049e
...
...
@@ -9,5 +9,8 @@ class GeoRepositoryFetchWorker
project
.
create_repository
unless
project
.
repository_exists?
project
.
repository
.
after_create
if
project
.
empty_repo?
project
.
repository
.
fetch_geo_mirror
(
clone_url
)
project
.
repository
.
expire_all_method_caches
project
.
repository
.
expire_branch_cache
project
.
repository
.
expire_content_cache
end
end
spec/workers/geo_repository_fetch_worker_spec.rb
View file @
c724049e
...
...
@@ -9,6 +9,10 @@ describe GeoRepositoryFetchWorker do
allow_any_instance_of
(
Repository
).
to
receive
(
:fetch_geo_mirror
).
and_return
(
true
)
allow_any_instance_of
(
Project
).
to
receive
(
:repository_exists?
)
{
false
}
allow_any_instance_of
(
Project
).
to
receive
(
:empty_repo?
)
{
true
}
allow_any_instance_of
(
Repository
).
to
receive
(
:expire_all_method_caches
)
allow_any_instance_of
(
Repository
).
to
receive
(
:expire_branch_cache
)
allow_any_instance_of
(
Repository
).
to
receive
(
:expire_content_cache
)
end
it
'creates a new repository'
do
...
...
@@ -28,6 +32,14 @@ describe GeoRepositoryFetchWorker do
perform
end
it
'expires repository caches'
do
expect_any_instance_of
(
Repository
).
to
receive
(
:expire_all_method_caches
)
expect_any_instance_of
(
Repository
).
to
receive
(
:expire_branch_cache
)
expect_any_instance_of
(
Repository
).
to
receive
(
:expire_content_cache
)
perform
end
end
def
perform
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment