统计提交数到db,调整
This commit is contained in:
parent
fe4751c2f5
commit
a4e26065b4
|
@ -3,10 +3,13 @@ namespace :total_commit_to_db do
|
|||
task done: :environment do
|
||||
project_name = ENV['name'] || "mindspore"
|
||||
puts "project_id=================#{project_name}"
|
||||
projects = Project.where(identifier: ['MindSpore-first-experience', ' MindSpore-install', 'MindSpore-Application-practice', 'MindSpore-Model-Development', 'MindSpore-Data-preprocessing', 'Mindspore-Data-storage-use', 'MindSpore-Data-storage-kunpeng', 'MindSpore-LeNet-jzx3', 'MindSpore-competition'] )
|
||||
|
||||
if ENV['project_id'].present?
|
||||
projects = Project.where(id: ENV['project_id'])
|
||||
else
|
||||
projects = Project.where(identifier: ['MindSpore-first-experience', ' MindSpore-install', 'MindSpore-Application-practice', 'MindSpore-Model-Development', 'MindSpore-Data-preprocessing', 'Mindspore-Data-storage-use', 'MindSpore-Data-storage-kunpeng', 'MindSpore-LeNet-jzx3', 'MindSpore-competition'] )
|
||||
end
|
||||
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: 200, token: project.owner.gitea_token)
|
||||
next if result.blank? || result[:total_count].blank?
|
||||
total_count = result[:total_count]
|
||||
# next if total_count > 2000
|
||||
|
|
Loading…
Reference in New Issue