forked from Gitlink/forgeplus
Change
This commit is contained in:
parent
db6aa954b1
commit
88d98f0ac4
|
@ -39,7 +39,7 @@ class SyncForgeProjectJob < ApplicationJob
|
||||||
def rand_user
|
def rand_user
|
||||||
user_ids = User.select(:id, :type).where(type: "User").pluck(:id)
|
user_ids = User.select(:id, :type).where(type: "User").pluck(:id)
|
||||||
range_user_id = user_ids[rand(user_ids.length-1)]
|
range_user_id = user_ids[rand(user_ids.length-1)]
|
||||||
rand_sync_user = User.select(:id, :login).find_by_id(range_user_id) #生成随机用户
|
rand_sync_user = User.find_by_id(range_user_id) #生成随机用户
|
||||||
unless rand_sync_user.present?
|
unless rand_sync_user.present?
|
||||||
rand_user
|
rand_user
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,7 +2,7 @@ require 'uri'
|
||||||
require 'net/http'
|
require 'net/http'
|
||||||
|
|
||||||
class SyncForgeProjectsRake
|
class SyncForgeProjectsRake
|
||||||
# 运行示例: 检查哪些项目的repo不存在,bundle exec rails runner "SyncForgeProjectsRake.new.call(5)"
|
# 运行示例: 检查哪些项目的repo不存在,bundle exec rails runner "SyncForgeProjectsRake.new.call(5)" -e production
|
||||||
|
|
||||||
def call(count)
|
def call(count)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue