Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
443b8855502b
Commit
443b8855
authored
Apr 22, 2016
by
Stan Hu
Browse files
Fix Error 500 due to stale cache when projects are renamed or transferred
Closes gitlab-org/gitlab-ee#506
parent
4ee1b47c7be4
Changes
4
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
443b8855
...
...
@@ -8,6 +8,7 @@
- Fix license detection to detect all license files, not only known licenses. !3878
- Use the `can?` helper instead of `current_user.can?`. !3882
- Prevent users from deleting Webhooks via API they do not own
- Fix Error 500 due to stale cache when projects are renamed or transferred
v 8.7.0
- Gitlab::GitAccess and Gitlab::GitAccessWiki are now instrumented
...
...
app/models/project.rb
View file @
443b8855
...
...
@@ -820,8 +820,7 @@
wiki
=
Repository
.
new
(
"
#{
old_path
}
.wiki"
,
self
)
if
repo
.
exists?
repo
.
expire_cache
repo
.
expire_emptiness_caches
repo
.
before_delete
end
if
wiki
.
exists?
...
...
@@ -825,8 +824,7 @@
end
if
wiki
.
exists?
wiki
.
expire_cache
wiki
.
expire_emptiness_caches
wiki
.
before_delete
end
end
...
...
app/services/projects/transfer_service.rb
View file @
443b8855
...
...
@@ -34,6 +34,8 @@
raise
TransferError
.
new
(
"Project with same path in target namespace already exists"
)
end
project
.
expire_caches_before_rename
(
old_path
)
# Apply new namespace id and visibility level
project
.
namespace
=
new_namespace
project
.
visibility_level
=
new_namespace
.
visibility_level
unless
project
.
visibility_level_allowed_by_group?
...
...
spec/models/project_spec.rb
View file @
443b8855
...
...
@@ -719,11 +719,8 @@
with
(
'foo.wiki'
,
project
).
and_return
(
wiki
)
expect
(
repo
).
to
receive
(
:expire_cache
)
expect
(
repo
).
to
receive
(
:expire_emptiness_caches
)
expect
(
wiki
).
to
receive
(
:expire_cache
)
expect
(
wiki
).
to
receive
(
:expire_emptiness_caches
)
expect
(
repo
).
to
receive
(
:before_delete
)
expect
(
wiki
).
to
receive
(
:before_delete
)
project
.
expire_caches_before_rename
(
'foo'
)
end
...
...
Write
Preview
Supports
Markdown
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