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
Tatuya Kamada
gitlab-ce
Commits
d1ffbdfc
Commit
d1ffbdfc
authored
Oct 10, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid 500 error on project page when application is close to RAM limit
parent
bd83991a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+9
-0
app/views/projects/show.html.haml
app/views/projects/show.html.haml
+1
-1
No files found.
app/helpers/projects_helper.rb
View file @
d1ffbdfc
...
@@ -131,4 +131,13 @@ module ProjectsHelper
...
@@ -131,4 +131,13 @@ module ProjectsHelper
"your@email.com"
"your@email.com"
end
end
end
end
def
repository_size
"
#{
@project
.
repository
.
size
}
MB"
rescue
# In order to prevent 500 error
# when application cannot allocate memory
# to calculate repo size - just show 'Unknown'
'unknown'
end
end
end
app/views/projects/show.html.haml
View file @
d1ffbdfc
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
%p
%p
%p
%p
%span
.light
Repo size is
%span
.light
Repo size is
#{
@project
.
repository
.
size
}
MB
=
repository_size
%p
%p
%span
.light
Created at
%span
.light
Created at
#{
@project
.
created_at
.
stamp
(
'Aug 22, 2013'
)
}
#{
@project
.
created_at
.
stamp
(
'Aug 22, 2013'
)
}
...
...
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