Browse Source

Change

tags/v1.0.0
sylor_huang@126.com 5 years ago
parent
commit
ae4161fa9b
2 changed files with 3 additions and 3 deletions
  1. +1
    -1
      app/controllers/sync_forge_controller.rb
  2. +2
    -2
      app/jobs/sync_project_military_job.rb

+ 1
- 1
app/controllers/sync_forge_controller.rb View File

@@ -5,7 +5,7 @@ class SyncForgeController < ApplicationController
sync_counts = params[:sync_count] || 10
projects = Project.includes(:project_score, :repository)
.where(is_public: true)
.where.not(identifier: ["educoder","trustieforge", "gitlab"])
.where.not(identifier: ["educoder","trustieforge", "gitlab", "rGDBbQmOK", "socialforge"])
.joins(:project_score).order("project_scores.changeset_num desc").limit(sync_counts.to_i)
projects.each do | project |
SyncProjectMilitaryJob.perform_later(project, project.repository, project.project_score)


+ 2
- 2
app/jobs/sync_project_military_job.rb View File

@@ -5,8 +5,8 @@ class SyncProjectMilitaryJob < ApplicationJob
queue_as :default

def perform(project, repository, project_socre)
SyncLog.sync_log("============begin to sync project ===========")
project_except_params = %w(id user_id praises_count watchers_count issues_count pull_requests_count versions_count issue_tags_count closed_issues_count)
SyncLog.sync_log("============begin to sync project, project_id: #{project.id} ===========")
project_except_params = %w(id user_id praises_count watchers_count issues_count pull_requests_count versions_count issue_tags_count closed_issues_count forked_from_project_id forked_count)
project_params = {
project: project.as_json(except: project_except_params),
repository: repository.as_json(except: %w(id project_id login user_id)),


Loading…
Cancel
Save