Commit 9711acc9e1e24955a28ab09994bbfd9ed538aeb3

Authored by Dmitriy Zaporozhets
1 parent 7300440a

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 105  
106 106 def commit_count
107 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 113 end
110 114 end
111 115  
... ...