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
b2959c41
Commit
b2959c41
authored
Apr 09, 2014
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove archives older than 2 hours.
parent
71678f08
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
0 deletions
+7
-0
app/controllers/projects/repositories_controller.rb
app/controllers/projects/repositories_controller.rb
+2
-0
app/models/repository.rb
app/models/repository.rb
+5
-0
No files found.
app/controllers/projects/repositories_controller.rb
View file @
b2959c41
...
@@ -16,6 +16,8 @@ class Projects::RepositoriesController < Projects::ApplicationController
...
@@ -16,6 +16,8 @@ class Projects::RepositoriesController < Projects::ApplicationController
storage_path
=
Gitlab
.
config
.
gitlab
.
repository_downloads_path
storage_path
=
Gitlab
.
config
.
gitlab
.
repository_downloads_path
@repository
.
clean_old_archives
file_path
=
@repository
.
archive_repo
(
params
[
:ref
],
storage_path
,
params
[
:format
].
downcase
)
file_path
=
@repository
.
archive_repo
(
params
[
:ref
],
storage_path
,
params
[
:format
].
downcase
)
if
file_path
if
file_path
...
...
app/models/repository.rb
View file @
b2959c41
...
@@ -215,4 +215,9 @@ class Repository
...
@@ -215,4 +215,9 @@ class Repository
def
last_commit_for_path
(
sha
,
path
)
def
last_commit_for_path
(
sha
,
path
)
commits
(
sha
,
path
,
1
).
last
commits
(
sha
,
path
,
1
).
last
end
end
# Remove archives older than 2 hours
def
clean_old_archives
Gitlab
::
Popen
.
popen
(
%W(find
#{
Gitlab
.
config
.
gitlab
.
repository_downloads_path
}
-mmin +120 -delete)
)
end
end
end
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