From e2da18a7635a994d3d3a6fcf8976e96ea4dc3f88 Mon Sep 17 00:00:00 2001 From: Naoki Takezoe Date: Mon, 28 May 2018 00:46:53 +0900 Subject: [PATCH] (refs #2030) Fix isolation level issue in MySQL --- .../scala/gitbucket/core/controller/ApiController.scala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/scala/gitbucket/core/controller/ApiController.scala b/src/main/scala/gitbucket/core/controller/ApiController.scala index 6b8c4ade6..784d02594 100644 --- a/src/main/scala/gitbucket/core/controller/ApiController.scala +++ b/src/main/scala/gitbucket/core/controller/ApiController.scala @@ -11,6 +11,8 @@ import gitbucket.core.util.JGitUtil._ import gitbucket.core.util.SyntaxSugars._ import gitbucket.core.util._ import gitbucket.core.plugin.PluginRegistry +import gitbucket.core.servlet.Database +import gitbucket.core.model.Profile.profile.blockingApi._ import gitbucket.core.view.helpers.{isRenderable, renderMarkup} import org.eclipse.jgit.api.Git import org.eclipse.jgit.revwalk.RevWalk @@ -315,7 +317,10 @@ trait ApiControllerBase extends ControllerBase { data.auto_init ) Await.result(f, Duration.Inf) - val repository = getRepository(owner, data.name).get + + val repository = Database() withTransaction { session => + getRepository(owner, data.name)(session).get + } JsonFormat(ApiRepository(repository, ApiUser(getAccountByUserName(owner).get))) } else { ApiError(