Commit 9711acc9e1e24955a28ab09994bbfd9ed538aeb3
1 parent
7300440a
Exists in
master
and in
4 other branches
Prevent 500 on project home page if project has extremely huge number of commits
Showing
1 changed file
with
5 additions
and
1 deletions
Show diff stats
app/models/repository.rb
@@ -105,7 +105,11 @@ class Repository | @@ -105,7 +105,11 @@ class Repository | ||
105 | 105 | ||
106 | def commit_count | 106 | def commit_count |
107 | Rails.cache.fetch(cache_key(:commit_count)) do | 107 | Rails.cache.fetch(cache_key(:commit_count)) do |
108 | - raw_repository.raw.commit_count | 108 | + begin |
109 | + raw_repository.raw.commit_count | ||
110 | + rescue | ||
111 | + 0 | ||
112 | + end | ||
109 | end | 113 | end |
110 | end | 114 | end |
111 | 115 |