From 48f8ce55810ec6198277ff74fe4e61720d29a4cc Mon Sep 17 00:00:00 2001 From: "sylor_huang@126.com" Date: Mon, 20 Apr 2020 16:02:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9gitea=E5=88=9B=E5=BB=BAgitfil?= =?UTF-8?q?e=E7=9A=84=E9=94=99=E8=AF=AF=E6=8D=95=E8=8E=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/gitea_create_repository.rake | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/tasks/gitea_create_repository.rake b/lib/tasks/gitea_create_repository.rake index d680bbf1b..c5f1244fb 100644 --- a/lib/tasks/gitea_create_repository.rake +++ b/lib/tasks/gitea_create_repository.rake @@ -19,8 +19,14 @@ namespace :gitea_create_repository do auto_init: true, private: r.hidden, } - gitea_repository = Gitea::Repository::CreateService.new(user.gitea_token, repository_params).call - puts "__________after_create_gitea_repository_____#{gitea_repository}______" + ActiveRecord::Base.transaction do + begin + gitea_repository = Gitea::Repository::CreateService.new(user.gitea_token, repository_params).call + puts "__________after_create_gitea_repository_____#{gitea_repository}______" + rescue => e + puts "_________create_gitea_git________file______error: #{e}" + end + end else puts "__________delete_gitea__repository_failed,status:_____#{delete_gitea.status}______" end