This commit is contained in:
sylor_huang@126.com 2020-08-12 16:24:30 +08:00
parent db6aa954b1
commit 88d98f0ac4
2 changed files with 2 additions and 2 deletions

View File

@ -39,7 +39,7 @@ class SyncForgeProjectJob < ApplicationJob
def rand_user
user_ids = User.select(:id, :type).where(type: "User").pluck(:id)
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?
rand_user
end

View File

@ -2,7 +2,7 @@ require 'uri'
require 'net/http'
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)