新增:forks特殊显示逻辑

This commit is contained in:
yystopf 2023-03-23 12:01:09 +08:00
parent 7fe204056d
commit c891fcf836
1 changed files with 2 additions and 2 deletions

View File

@ -24,9 +24,9 @@ class RepositoriesController < ApplicationController
@result = Repositories::DetailService.call(@owner, @repository, @user)
cache_total_forks = $redis_cache.get("ProjectSpecialForks:#{@project.id}")
if cache_total_forks.present?
@project_forked_count = @project.forked_count.to_i
else
@project_forked_count = cache_total_forks.to_i
else
@project_forked_count = @project.forked_count.to_i
end
@project_fork_id = @project.try(:forked_from_project_id)
if @project_fork_id.present?