Commit 563495a5 authored by Rémy Coutable's avatar Rémy Coutable

Add Project.cached_count method (CE up-port)

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent d97eead4
......@@ -408,6 +408,12 @@ class Project < ActiveRecord::Base
joins(join_body).reorder('join_note_counts.amount DESC')
end
def cached_count
Rails.cache.fetch('total_project_count', expires_in: 5.minutes) do
Project.count
end
end
end
def repository_storage_path
......
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