Commit fe934a2d authored by tiagonbotelho's avatar tiagonbotelho Committed by Yorick Peterse

adds cache to languages list

parent 73535b80
...@@ -948,10 +948,10 @@ class Project < ActiveRecord::Base ...@@ -948,10 +948,10 @@ class Project < ActiveRecord::Base
def main_language def main_language
if !empty_repo? if !empty_repo?
languages = Linguist::Repository.new( Rails.cache.fetch([self, "language"]) do
@repository.rugged, languages = Linguist::Repository.new(@repository.rugged, @repository.rugged.head.target_id).languages
@repository.rugged.head.target_id).languages languages.key(languages.values.max)
return languages.key(languages.values.max) end
end end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment