提交 d1ffbdfc 编写于 作者: D Dmitriy Zaporozhets

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

上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册