|
|
@@ -66,23 +66,8 @@ public class DeployStatImpl implements DeployStat {
|
|
|
public boolean delete(AppDeployConfig appDeployConfig) {
|
|
|
String appId = appDeployConfig.getAppConfig().getAppId();
|
|
|
String machineId = appDeployConfig.getMachineHost().getMachineId();
|
|
|
- /*AppDeploying appDeploying = deployingRepository.findAllByAppDeployConfig_AppConfig_AppIdAndAppDeployConfig_MachineHost_MachineId(appId, machineId);
|
|
|
- if (appDeploying == null) {
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- for (AppDeployingNode appDeployingNode : appDeploying.getDeployingNodes()) {
|
|
|
- AppDeployConfig deployConfig = appDeployingNode.getDeployConfig();
|
|
|
- if (deployConfig.equals(appDeployConfig)) {
|
|
|
- int pid = appDeployingNode.getPid();
|
|
|
- if (pid == -1) {
|
|
|
- deployingRepository.delete(appDeploying);
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
- }*/
|
|
|
-
|
|
|
- return false;
|
|
|
+ delete(appId, machineId);
|
|
|
+ return true;
|
|
|
}
|
|
|
|
|
|
public void delete(String appId, String machineId) {
|
|
|
@@ -149,7 +134,6 @@ public class DeployStatImpl implements DeployStat {
|
|
|
}
|
|
|
|
|
|
MachineHost machineHost = deployNode.getDeployConfig().getMachineHost();
|
|
|
- // BuildLog buildLog = buildLogRepository.findByBuildLogId(appDeploying.getAppBuilding().getBuildLogId());
|
|
|
BuildLog buildLog = appDeploying.getBuildLog();
|
|
|
DeployLog deployLog = new DeployLog(buildLog, machineHost, deployResult);
|
|
|
deployLogRepository.save(deployLog);
|
|
|
@@ -166,13 +150,6 @@ public class DeployStatImpl implements DeployStat {
|
|
|
public void refresh(EvtAppStatResult statResult) {
|
|
|
}
|
|
|
|
|
|
- private void getApp(String appId) {
|
|
|
- AppDeploying appDeploying = deployingRepository.findByAppConfig_AppId(appId);
|
|
|
- for (AppDeployingNode deployNode : appDeploying.getDeployingNodes()) {
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
@Override
|
|
|
public List<AppInfo> getAppsByMachineId(String machineId) {
|
|
|
return deployingRepository.findAll().stream()
|
|
|
@@ -269,8 +246,16 @@ public class DeployStatImpl implements DeployStat {
|
|
|
|
|
|
@Override
|
|
|
public boolean isRunning(String appId) {
|
|
|
- List<AppDeploying> list = Collections.emptyList();
|
|
|
- return !list.isEmpty();
|
|
|
+ AppDeploying appDeploying = deployingRepository.findByAppConfig_AppId(appId);
|
|
|
+ List<AppDeployingNode> deployingNodes = appDeploying.getDeployingNodes();
|
|
|
+ for (AppDeployingNode appDeployingNode : deployingNodes) {
|
|
|
+ int pid = appDeployingNode.getPid();
|
|
|
+ if (pid != -1) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
}
|
|
|
|
|
|
@Override
|