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
61a36b46
Commit
61a36b46
authored
Mar 12, 2018
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test cache methods and expire Wiki caches as well
parent
f052560c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
1 deletion
+9
-1
ee/app/models/ee/repository.rb
ee/app/models/ee/repository.rb
+1
-1
ee/app/services/geo/wiki_sync_service.rb
ee/app/services/geo/wiki_sync_service.rb
+6
-0
ee/spec/services/geo/repository_sync_service_spec.rb
ee/spec/services/geo/repository_sync_service_spec.rb
+1
-0
ee/spec/services/geo/wiki_sync_service_spec.rb
ee/spec/services/geo/wiki_sync_service_spec.rb
+1
-0
No files found.
ee/app/models/ee/repository.rb
View file @
61a36b46
...
...
@@ -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
...
...
ee/app/services/geo/wiki_sync_service.rb
View file @
61a36b46
...
...
@@ -24,6 +24,7 @@ module Geo
fail_registry!
(
'Invalid wiki'
,
e
,
force_to_redownload_wiki:
true
)
ensure
clean_up_temporary_repository
if
redownload
expire_repository_caches
end
def
ssh_url_to_wiki
...
...
@@ -38,6 +39,11 @@ module Geo
project
.
wiki
.
ensure_repository
end
def
expire_repository_caches
log_info
(
'Expiring caches'
)
repository
.
after_sync
end
def
mark_sync_as_successful
update_registry!
(
finished_at:
DateTime
.
now
,
attrs:
{
last_wiki_sync_failure:
nil
})
...
...
ee/spec/services/geo/repository_sync_service_spec.rb
View file @
61a36b46
...
...
@@ -309,6 +309,7 @@ describe Geo::RepositorySyncService do
force_to_redownload_repository:
true
)
expect
(
project
.
repository
).
to
receive
(
:expire_exists_cache
).
twice
.
and_call_original
expect
(
subject
).
not_to
receive
(
:fail_registry!
)
subject
.
execute
...
...
ee/spec/services/geo/wiki_sync_service_spec.rb
View file @
61a36b46
...
...
@@ -181,6 +181,7 @@ RSpec.describe Geo::WikiSyncService do
force_to_redownload_wiki:
true
)
expect
(
project
.
wiki
.
repository
).
to
receive
(
:expire_exists_cache
).
twice
.
and_call_original
expect
(
subject
).
not_to
receive
(
:fail_registry!
)
subject
.
execute
...
...
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