FIX delete Chain job when create repo
This commit is contained in:
parent
21169b4523
commit
a8cbe566cb
|
@ -14,18 +14,18 @@ class Repositories::CreateService < ApplicationService
|
|||
gitea_repository = Gitea::Repository::CreateService.new(user.gitea_token, gitea_repository_params).call
|
||||
sync_project(@repository, gitea_repository)
|
||||
sync_repository(@repository, gitea_repository)
|
||||
if project.project_type == "common"
|
||||
chain_params = {
|
||||
type: "create",
|
||||
chain_params:{
|
||||
username: user.try(:login),
|
||||
reponame: @repository.try(:identifier),
|
||||
token_name: @repository.try(:identifier),
|
||||
total_supply: 1000000
|
||||
}
|
||||
}
|
||||
PostChainJob.perform_later(chain_params) #创建上链操作
|
||||
end
|
||||
# if project.project_type == "common"
|
||||
# chain_params = {
|
||||
# type: "create",
|
||||
# chain_params:{
|
||||
# username: user.try(:login),
|
||||
# reponame: @repository.try(:identifier),
|
||||
# token_name: @repository.try(:identifier),
|
||||
# total_supply: 1000000
|
||||
# }
|
||||
# }
|
||||
# PostChainJob.perform_later(chain_params) #创建上链操作
|
||||
# end
|
||||
else
|
||||
Rails.logger.info("#############___________create_repository_erros______###########{@repository.errors.messages}")
|
||||
end
|
||||
|
@ -38,7 +38,7 @@ class Repositories::CreateService < ApplicationService
|
|||
|
||||
private
|
||||
|
||||
def sync_project(repository, gitea_repository)
|
||||
def sync_project(repository, gitea_repository)
|
||||
if gitea_repository
|
||||
project.update_columns(
|
||||
gpid: gitea_repository["id"],
|
||||
|
|
Loading…
Reference in New Issue