|
|
|
@@ -169,12 +169,18 @@ class RepositoriesController < ApplicationController |
|
|
|
end
|
|
|
|
|
|
|
|
def contributors
|
|
|
|
if params[:filepath].present? || @project.educoder?
|
|
|
|
@contributors = []
|
|
|
|
else
|
|
|
|
result = Gitea::Repository::Contributors::GetService.call(@owner, @repository.identifier, {page: params[:page], limit: params[:limit]})
|
|
|
|
@total_count = result[:total_count]
|
|
|
|
@contributors = result.is_a?(Hash) ? result[:body] : []
|
|
|
|
@cache_result = $redis_cache.get("ProjectSpecialCommit:#{@project.id}")
|
|
|
|
if @cache_result.present?
|
|
|
|
@total_count = Project.mindspore_contributors.size
|
|
|
|
@contributors = kaminari_array_paginate(Project.mindspore_contributors)
|
|
|
|
else
|
|
|
|
if params[:filepath].present? || @project.educoder?
|
|
|
|
@contributors = []
|
|
|
|
else
|
|
|
|
result = Gitea::Repository::Contributors::GetService.call(@owner, @repository.identifier, {page: params[:page], limit: params[:limit]})
|
|
|
|
@total_count = result[:total_count]
|
|
|
|
@contributors = result.is_a?(Hash) ? result[:body] : []
|
|
|
|
end
|
|
|
|
end
|
|
|
|
rescue
|
|
|
|
@contributors = []
|
|
|
|
|