Browse Source

CHange

pull/278/head
sylor_huang@126.com 5 years ago
parent
commit
d3636e686b
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      app/jobs/sync_forge_project_job.rb

+ 1
- 1
app/jobs/sync_forge_project_job.rb View File

@@ -37,7 +37,7 @@ class SyncForgeProjectJob < ApplicationJob
private

def rand_user
user_ids = User.select(:id, :type).where(type: "User").pluck(:id)
user_ids = User.select(:id, :type, :gitea_token, :gitea_uid).where("gitea_token is not null and gitea_uid is not null and type = ?", "User").pluck(:id)
range_user_id = user_ids[rand(user_ids.length-1)]
rand_sync_user = User.find_by_id(range_user_id) #生成随机用户
unless rand_sync_user.present?


Loading…
Cancel
Save