From 7d40bdf1d3b86b2641e764ebf55fca983aa58cfd Mon Sep 17 00:00:00 2001 From: liyuchun Date: Mon, 14 Mar 2022 15:53:33 +0800 Subject: [PATCH] * Finish task #50709. --- module/repo/control.php | 5 +++++ module/repo/lang/en.php | 1 + module/repo/lang/zh-cn.php | 1 + module/sonarqube/control.php | 4 ++-- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/module/repo/control.php b/module/repo/control.php index 7361fcf4b8..eea164d492 100644 --- a/module/repo/control.php +++ b/module/repo/control.php @@ -374,6 +374,11 @@ class repo extends control /* Get repo and synchronous commit. */ $repo = $this->repo->getRepoByID($repoID); + if($repo->SCM == 'Git' and !is_dir($repo->path)) + { + $error = sprintf($this->lang->repo->error->notFound, $repo->name, $repo->path); + return print(js::error($error) . js::locate($this->repo->createLink('maintain'))); + } if(!$repo->synced) $this->locate($this->repo->createLink('showSyncCommit', "repoID=$repoID")); /* Set branch for git. */ diff --git a/module/repo/lang/en.php b/module/repo/lang/en.php index 0d698011c0..8f0e1cb6bf 100644 --- a/module/repo/lang/en.php +++ b/module/repo/lang/en.php @@ -185,6 +185,7 @@ $lang->repo->error->encoding = "The encoding might be wrong. Please change $lang->repo->error->deleted = "Deletion of the repository failed. The current repository has a commit record associated with the design."; $lang->repo->error->linkedJob = "Deletion of the repository failed. The current repository has associated with the Compile."; $lang->repo->error->clientPath = "The client installation directory cannot have spaces!"; +$lang->repo->error->notFound = "The repository %s’s URL %s does not exist. Please confirm if this repository has been deleted from the local server."; $lang->repo->syncTips = 'You may find the reference about how to set Git sync from here.'; $lang->repo->encodingsTips = "The encodings of comments can be comma separated values, e.g. utf-8."; diff --git a/module/repo/lang/zh-cn.php b/module/repo/lang/zh-cn.php index c3690fd63a..4ee9a879af 100644 --- a/module/repo/lang/zh-cn.php +++ b/module/repo/lang/zh-cn.php @@ -185,6 +185,7 @@ $lang->repo->error->encoding = "编码可能错误,请更换编码重试 $lang->repo->error->deleted = "删除版本库失败,当前版本库有提交记录与设计关联"; $lang->repo->error->linkedJob = "删除版本库失败,当前版本库与构建有关联,请取消关联或删除构建。"; $lang->repo->error->clientPath = "客户端安装目录不能有空格!"; +$lang->repo->error->notFound = "版本库『%s』路径 %s 不存在,请确认此版本库是否已在本地服务器被删除"; $lang->repo->syncTips = '请参照这里,设置版本库定时同步。'; $lang->repo->encodingsTips = "提交日志的编码,可以用逗号连接起来的多个,比如utf-8。"; diff --git a/module/sonarqube/control.php b/module/sonarqube/control.php index 02f617ed4e..b40685e53c 100644 --- a/module/sonarqube/control.php +++ b/module/sonarqube/control.php @@ -359,11 +359,11 @@ class sonarqube extends control if($search == true) $keyword = $this->session->sonarqubeIssueKeyword; } + ini_set('memory_limit', '256M'); + $cacheFile = $this->sonarqube->getCacheFile($sonarqubeID, $projectKey); if(!$cacheFile or !file_exists($cacheFile) or (time() - filemtime($cacheFile)) / 60 > $this->config->sonarqube->cacheTime) { - ini_set('memory_limit', '256M'); - $sonarqubeIssueList = $this->sonarqube->apiGetIssues($sonarqubeID, $projectKey); foreach($sonarqubeIssueList as $key => $sonarqubeIssue) {