From a8cbe566cbabbbe652c17cd211df3124fb8170f9 Mon Sep 17 00:00:00 2001 From: Jasder <2053003901@@qq.com> Date: Fri, 27 Nov 2020 09:39:46 +0800 Subject: [PATCH] FIX delete Chain job when create repo --- app/services/repositories/create_service.rb | 26 ++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/app/services/repositories/create_service.rb b/app/services/repositories/create_service.rb index 219c2db33..9458e513f 100644 --- a/app/services/repositories/create_service.rb +++ b/app/services/repositories/create_service.rb @@ -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"],