创建仓库开通建木DevOps job延迟5秒

This commit is contained in:
xxq250 2023-02-01 17:03:16 +08:00
parent c4b93f2bd3
commit 785ae13649
2 changed files with 2 additions and 2 deletions

View File

@ -53,7 +53,7 @@ class ProjectsController < ApplicationController
ActiveRecord::Base.transaction do
Projects::CreateForm.new(project_params).validate!
@project = Projects::CreateService.new(current_user, project_params).call
OpenProjectDevOpsJob.perform_later(@project&.id, current_user.id)
OpenProjectDevOpsJob.set(wait: 5.seconds).perform_later(@project&.id, current_user.id)
end
rescue Exception => e
uid_logger_error(e.message)

View File

@ -15,7 +15,7 @@ class MigrateRemoteRepositoryJob < ApplicationJob
## open jianmu devops
project_id = repo&.project&.id
puts "############ mirror project_id,user_id: #{project_id},#{user_id} ############"
OpenProjectDevOpsJob.perform_later(project_id, user_id) if project_id.present? && user_id.present?
OpenProjectDevOpsJob.set(wait: 5.seconds).perform_later(project_id, user_id) if project_id.present? && user_id.present?
puts "############ mirror status: #{repo.mirror.status} ############"
else
repo&.mirror&.failed!