Commit 529c3c3e authored by 赵啸非's avatar 赵啸非

添加php健康度检测

parent 1fcb0f7d
...@@ -49,9 +49,9 @@ public class CheckProjectStatusTaskImpl implements ITaskExcuteService { ...@@ -49,9 +49,9 @@ public class CheckProjectStatusTaskImpl implements ITaskExcuteService {
if (ProjectTypeEnum.后端.getValue() == setupProjectEntity.getProjectType()) { if (ProjectTypeEnum.后端.getValue() == setupProjectEntity.getProjectType()) {
//todo http://192.168.0.250:8848/nacos/v1/ns/catalog/instances?message=true&serviceName=bill-manager&clusterName=DEFAULT&groupName=DEFAULT_GROUP&pageSize=10&pageNo=1&namespaceId=smart-gov //todo http://192.168.0.250:8848/nacos/v1/ns/catalog/instances?message=true&serviceName=bill-manager&clusterName=DEFAULT&groupName=DEFAULT_GROUP&pageSize=10&pageNo=1&namespaceId=smart-gov
String serverUrl = nacosUrl + "/nacos/v1/ns/catalog/instances?message=true&serviceName=" + setupProjectEntity.getProjectCode() + "&clusterName=DEFAULT&groupName=DEFAULT_GROUP&pageSize=10&pageNo=1&namespaceId=smart-gov"; String serverUrl = nacosUrl + "/nacos/v1/ns/catalog/instances?message=true&serviceName=" + setupProjectEntity.getProjectCode() + "&clusterName=DEFAULT&groupName=DEFAULT_GROUP&pageSize=10&pageNo=1&namespaceId=smart-gov";
String resp = HttpUtil.get(serverUrl); String resp = "";
try { try {
resp = HttpUtil.get(serverUrl);
NacosResponse nacosResponse = JSON.parseObject(resp, new TypeReference<NacosResponse>() { NacosResponse nacosResponse = JSON.parseObject(resp, new TypeReference<NacosResponse>() {
}); });
int count = nacosResponse.getCount(); int count = nacosResponse.getCount();
...@@ -97,9 +97,9 @@ public class CheckProjectStatusTaskImpl implements ITaskExcuteService { ...@@ -97,9 +97,9 @@ public class CheckProjectStatusTaskImpl implements ITaskExcuteService {
//todo 前端 判断路径文件是否存在 如果存在 则代表运行 //todo 前端 判断路径文件是否存在 如果存在 则代表运行
if (ProductDisEnum.排号系统PHP后端.getValue().equals(setupProjectEntity.getProjectCode())) { if (ProductDisEnum.排号系统PHP后端.getValue().equals(setupProjectEntity.getProjectCode())) {
String serverUrl = "http://127.0.0.1:11078/zwfw_api/api/upload/dictionary"; String serverUrl = "http://127.0.0.1:11078/zwfw_api/api/upload/dictionary";
String resp = HttpUtil.get(serverUrl); String resp = "";
try { try {
resp = HttpUtil.get(serverUrl);
JSON.parseObject(resp); JSON.parseObject(resp);
setupProjectEntity.setProjectStatus(ProjectStatusEnum.运行中.getValue()); setupProjectEntity.setProjectStatus(ProjectStatusEnum.运行中.getValue());
setupProjectEntity.setUpdateTime(new Date()); setupProjectEntity.setUpdateTime(new Date());
...@@ -116,8 +116,9 @@ public class CheckProjectStatusTaskImpl implements ITaskExcuteService { ...@@ -116,8 +116,9 @@ public class CheckProjectStatusTaskImpl implements ITaskExcuteService {
if (ProductDisEnum.窗口服务行为监察PHP后端.getValue().equals(setupProjectEntity.getProjectCode())) { if (ProductDisEnum.窗口服务行为监察PHP后端.getValue().equals(setupProjectEntity.getProjectCode())) {
String serverUrl = "http://127.0.0.1:11030/admin/waited/verify"; String serverUrl = "http://127.0.0.1:11030/admin/waited/verify";
String resp = HttpUtil.get(serverUrl); String resp = "";
try { try {
resp = HttpUtil.get(serverUrl);
JSON.parseObject(resp); JSON.parseObject(resp);
setupProjectEntity.setProjectStatus(ProjectStatusEnum.运行中.getValue()); setupProjectEntity.setProjectStatus(ProjectStatusEnum.运行中.getValue());
setupProjectEntity.setUpdateTime(new Date()); setupProjectEntity.setUpdateTime(new Date());
......
...@@ -440,7 +440,7 @@ public class SetupProjectServiceImpl extends AbstractCRUDServiceImpl<SetupProjec ...@@ -440,7 +440,7 @@ public class SetupProjectServiceImpl extends AbstractCRUDServiceImpl<SetupProjec
log.info("originalFilename:{}", originalFilename); log.info("originalFilename:{}", originalFilename);
//解压目录,为当前工程目录 /home/publish/setup-manager/project/ //解压目录,为当前工程目录 /home/publish/setup-manager/project/
String projectPath = this.publishPath + "/temp/project/"; String projectPath = this.publishPath + "/temp/";
boolean exist = FileUtil.exist(projectPath); boolean exist = FileUtil.exist(projectPath);
if (!exist) { if (!exist) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment