Commit d1ffbdfc authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Avoid 500 error on project page when application is close to RAM limit

parent bd83991a
......@@ -131,4 +131,13 @@ module ProjectsHelper
"your@email.com"
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
......@@ -17,7 +17,7 @@
%p
%p
%span.light Repo size is
#{@project.repository.size} MB
= repository_size
%p
%span.light Created at
#{@project.created_at.stamp('Aug 22, 2013')}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment