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

This commit is contained in:
Dmitriy Zaporozhets
2013-10-10 11:05:49 +03:00
parent bd83991ac7
commit d1ffbdfcb6
2 changed files with 10 additions and 1 deletions
+9
View File
@@ -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
+1 -1
View File
@@ -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')}