Commit d1ffbdfcb63bbd50573cfda4c59217bb60e76c7e
1 parent
bd83991a
Exists in
master
and in
4 other branches
Avoid 500 error on project page when application is close to RAM limit
Showing
2 changed files
with
10 additions
and
1 deletions
Show diff stats
app/helpers/projects_helper.rb
... | ... | @@ -131,4 +131,13 @@ module ProjectsHelper |
131 | 131 | "your@email.com" |
132 | 132 | end |
133 | 133 | end |
134 | + | |
135 | + def repository_size | |
136 | + "#{@project.repository.size} MB" | |
137 | + rescue | |
138 | + # In order to prevent 500 error | |
139 | + # when application cannot allocate memory | |
140 | + # to calculate repo size - just show 'Unknown' | |
141 | + 'unknown' | |
142 | + end | |
134 | 143 | end | ... | ... |