FIX delete Chain job when create repo

This commit is contained in:
Jasder 2020-11-27 09:39:46 +08:00
parent 21169b4523
commit a8cbe566cb
1 changed files with 13 additions and 13 deletions

View File

@ -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"],