fixed 去掉统计缓存

This commit is contained in:
xxq250 2025-05-23 09:23:22 +08:00
parent aa364598a4
commit d86ad96055
1 changed files with 7 additions and 12 deletions

View File

@ -1,17 +1,12 @@
class HomeController < ApplicationController
def index
@user_count = Rails.cache.fetch("homecontroller:user_count", expires_in: 1.hours) do
User.count
end
@project_count = Rails.cache.fetch("homecontroller:project_count", expires_in: 1.hours) do
Project.count
end
@project_dataset_count = Rails.cache.fetch("homecontroller:project_dataset_count", expires_in: 1.hours) do
ProjectDataset.count
end
@commit_count = Rails.cache.fetch("homecontroller:commit_count", expires_in: 1.hours) do
CommitLog.count
end
@user_count = User.count
@project_count = Project.count
@project_dataset_count = ProjectDataset.count
@commit_count = CommitLog.count
end
end