From 52adcb378d58cbde7c2a6557150e84e7738a56ef Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 18 Dec 2015 21:29:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=A8=E9=87=8A=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/update_project_commits.rake | 52 +++++++++++++-------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/lib/tasks/update_project_commits.rake b/lib/tasks/update_project_commits.rake index d8a916819..96a283537 100644 --- a/lib/tasks/update_project_commits.rake +++ b/lib/tasks/update_project_commits.rake @@ -1,26 +1,26 @@ -#coding=utf-8 - -namespace :projects do - desc "sync some projects which just have sigle repository" - task :commits_count => :environment do - projects = Project.where("gpid is not null") - puts projects.count - projects.each do |project| - unless project.gpid.nil? - begin - url = "https://gittest.trustie.net/api/v3/projects/#{project.gpid}/repository/commits_total_count?private_token=kZUYYbAY12QSQ2Tx1zes&ref_name=master" - require 'net/http' - count = Net::HTTP.get(URI(url)) - puts "count is ===>#{count}" - ensure - puts "**************** #{project.id}" - end - project.update_attributes(:commits_count => count) - end - - end - end - - task :delete_rep => :environment do - end -end \ No newline at end of file +# #coding=utf-8 +# +# namespace :projects do +# desc "sync some projects which just have sigle repository" +# task :commits_count => :environment do +# projects = Project.where("gpid is not null") +# puts projects.count +# projects.each do |project| +# unless project.gpid.nil? +# begin +# url = "https://gittest.trustie.net/api/v3/projects/#{project.gpid}/repository/commits_total_count?private_token=kZUYYbAY12QSQ2Tx1zes&ref_name=master" +# require 'net/http' +# count = Net::HTTP.get(URI(url)) +# puts "count is ===>#{count}" +# ensure +# puts "**************** #{project.id}" +# end +# project.update_attributes(:commits_count => count) +# end +# +# end +# end +# +# task :delete_rep => :environment do +# end +# end \ No newline at end of file