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
0
Merge Requests
0
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
iv
gitlab-ce
Commits
b1f4d14f
Commit
b1f4d14f
authored
Nov 11, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up Repository cache code.
parent
153085a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
8 deletions
+14
-8
app/models/repository.rb
app/models/repository.rb
+14
-8
No files found.
app/models/repository.rb
View file @
b1f4d14f
...
...
@@ -105,29 +105,25 @@ class Repository
end
def
add_branch
(
branch_name
,
ref
)
cache
.
expire
(
:branch_names
)
@branches
=
nil
expire_branches_cache
gitlab_shell
.
add_branch
(
path_with_namespace
,
branch_name
,
ref
)
end
def
add_tag
(
tag_name
,
ref
,
message
=
nil
)
cache
.
expire
(
:tag_names
)
@tags
=
nil
expire_tags_cache
gitlab_shell
.
add_tag
(
path_with_namespace
,
tag_name
,
ref
,
message
)
end
def
rm_branch
(
branch_name
)
cache
.
expire
(
:branch_names
)
@branches
=
nil
expire_branches_cache
gitlab_shell
.
rm_branch
(
path_with_namespace
,
branch_name
)
end
def
rm_tag
(
tag_name
)
cache
.
expire
(
:tag_names
)
@tags
=
nil
expire_tags_cache
gitlab_shell
.
rm_tag
(
path_with_namespace
,
tag_name
)
end
...
...
@@ -169,6 +165,16 @@ class Repository
end
end
def
expire_tags_cache
cache
.
expire
(
:tag_names
)
@tags
=
nil
end
def
expire_branches_cache
cache
.
expire
(
:branch_names
)
@branches
=
nil
end
def
expire_cache
cache_keys
.
each
do
|
key
|
cache
.
expire
(
key
)
...
...
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