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

adds cache to languages list

parent ff67e627a6d7
......@@ -948,10 +948,10 @@ def wiki
def main_language
if !empty_repo?
languages = Linguist::Repository.new(
@repository.rugged,
@repository.rugged.head.target_id).languages
return languages.key(languages.values.max)
Rails.cache.fetch([self, "language"]) do
languages = Linguist::Repository.new(@repository.rugged, @repository.rugged.head.target_id).languages
languages.key(languages.values.max)
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