Skip to content

Commit

Permalink
代码优化
Browse files Browse the repository at this point in the history
  • Loading branch information
elunez committed Dec 22, 2019
1 parent 4e0deae commit 3769230
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public interface AppService {
* 导出数据
* @param queryAll /
* @param response /
* @throws IOException /
*/
void download(List<AppDto> queryAll, HttpServletResponse response) throws IOException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public interface DatabaseService {
* 导出数据
* @param queryAll /
* @param response /
* @throws IOException e
*/
void download(List<DatabaseDto> queryAll, HttpServletResponse response) throws IOException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public interface DeployHistoryService {
* 导出数据
* @param queryAll /
* @param response /
* @throws IOException /
*/
void download(List<DeployHistoryDto> queryAll, HttpServletResponse response) throws IOException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public interface DeployService {
* 导出数据
* @param queryAll /
* @param response /
* @throws IOException /
*/
void download(List<DeployDto> queryAll, HttpServletResponse response) throws IOException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public interface ServerDeployService {
* 导出数据
* @param queryAll /
* @param response /
* @throws IOException /
*/
void download(List<ServerDeployDto> queryAll, HttpServletResponse response) throws IOException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -158,7 +161,7 @@ private void deployApp(String fileSavePath, Long id) {
int i = 0;
boolean result = false;
// 由于启动应用需要时间,所以需要循环获取状态,如果超过30次,则认为是启动失败
while (i++ < 30){
while (i++ < count){
result = checkIsRunningStatus(port, executeShellUtil);
if(result){
break;
Expand Down Expand Up @@ -286,7 +289,7 @@ public String startServer(Deploy resources) {
int i = 0;
boolean result = false;
// 由于启动应用需要时间,所以需要循环获取状态,如果超过30次,则认为是启动失败
while (i++ < 30){
while (i++ < count){
result = checkIsRunningStatus(app.getPort(), executeShellUtil);
if(result){
break;
Expand Down Expand Up @@ -371,7 +374,7 @@ public String serverReduction(DeployHistory resources) {
int i = 0;
boolean result = false;
// 由于启动应用需要时间,所以需要循环获取状态,如果超过30次,则认为是启动失败
while (i++ < 30){
while (i++ < count){
result = checkIsRunningStatus(app.getPort(), executeShellUtil);
if(result){
break;
Expand Down

0 comments on commit 3769230

Please sign in to comment.