代码优化

pull/302/head
Elune 2019-12-22 13:58:36 +08:00
parent 4e0deae13d
commit 3769230743
6 changed files with 11 additions and 3 deletions

View File

@ -61,6 +61,7 @@ public interface AppService {
*
* @param queryAll /
* @param response /
* @throws IOException /
*/
void download(List<AppDto> queryAll, HttpServletResponse response) throws IOException;
}

View File

@ -68,6 +68,7 @@ public interface DatabaseService {
*
* @param queryAll /
* @param response /
* @throws IOException e
*/
void download(List<DatabaseDto> queryAll, HttpServletResponse response) throws IOException;
}

View File

@ -54,6 +54,7 @@ public interface DeployHistoryService {
*
* @param queryAll /
* @param response /
* @throws IOException /
*/
void download(List<DeployHistoryDto> queryAll, HttpServletResponse response) throws IOException;
}

View File

@ -96,6 +96,7 @@ public interface DeployService {
*
* @param queryAll /
* @param response /
* @throws IOException /
*/
void download(List<DeployDto> queryAll, HttpServletResponse response) throws IOException;
}

View File

@ -75,6 +75,7 @@ public interface ServerDeployService {
*
* @param queryAll /
* @param response /
* @throws IOException /
*/
void download(List<ServerDeployDto> queryAll, HttpServletResponse response) throws IOException;
}

View File

@ -48,6 +48,9 @@ public class DeployServiceImpl implements DeployService {
private final DeployHistoryService deployHistoryService;
// 循环次数
private final Integer count = 30;
public DeployServiceImpl(DeployRepository deployRepository, DeployMapper deployMapper, ServerDeployService serverDeployService, DeployHistoryService deployHistoryService) {
this.deployRepository = deployRepository;
this.deployMapper = deployMapper;
@ -158,7 +161,7 @@ public class DeployServiceImpl implements DeployService {
int i = 0;
boolean result = false;
// 由于启动应用需要时间所以需要循环获取状态如果超过30次则认为是启动失败
while (i++ < 30){
while (i++ < count){
result = checkIsRunningStatus(port, executeShellUtil);
if(result){
break;
@ -286,7 +289,7 @@ public class DeployServiceImpl implements DeployService {
int i = 0;
boolean result = false;
// 由于启动应用需要时间所以需要循环获取状态如果超过30次则认为是启动失败
while (i++ < 30){
while (i++ < count){
result = checkIsRunningStatus(app.getPort(), executeShellUtil);
if(result){
break;
@ -371,7 +374,7 @@ public class DeployServiceImpl implements DeployService {
int i = 0;
boolean result = false;
// 由于启动应用需要时间所以需要循环获取状态如果超过30次则认为是启动失败
while (i++ < 30){
while (i++ < count){
result = checkIsRunningStatus(app.getPort(), executeShellUtil);
if(result){
break;