统计提交数 log

This commit is contained in:
xxq250 2023-03-23 17:37:00 +08:00
parent c7e2ae0699
commit 9dd8de07dc
1 changed files with 1 additions and 0 deletions

View File

@ -12,6 +12,7 @@ namespace :total_commit_count do
# projects = Project.where(:name => 'opensource0311') # projects = Project.where(:name => 'opensource0311')
projects.each_with_index do |project, index| projects.each_with_index do |project, index|
result = Gitea::Repository::Commits::ListService.call(project.owner.login,project.identifier,sha: "", page: 1, limit: 5, token: project.owner.gitea_token) result = Gitea::Repository::Commits::ListService.call(project.owner.login,project.identifier,sha: "", page: 1, limit: 5, token: project.owner.gitea_token)
next if result.blank? || result[:total_count].blank?
total_count = result[:total_count] total_count = result[:total_count]
next if total_count > 2000 next if total_count > 2000
puts "#{index} total_count==========#{total_count}" puts "#{index} total_count==========#{total_count}"