|
@@ -102,7 +102,7 @@ public class TickScheduler {
|
|
String key = manualProjectTopic + ":" + projectId + ":check";
|
|
String key = manualProjectTopic + ":" + projectId + ":check";
|
|
String lastNowString = redisTemplate.opsForValue().get(manualProjectTopic + ":" + projectId + ":check");
|
|
String lastNowString = redisTemplate.opsForValue().get(manualProjectTopic + ":" + projectId + ":check");
|
|
String podList = SshUtil.execute(session, "kubectl get pod | grep project-" + projectId);
|
|
String podList = SshUtil.execute(session, "kubectl get pod | grep project-" + projectId);
|
|
- log.info("TickScheduler-------checkProject 项目 " + projectId + " 正在运行的 pod 为" + podList);
|
|
|
|
|
|
+ log.info("TickScheduler-------checkProject 项目 " + projectId + " 正在运行的 pod 为:\n" + podList);
|
|
int taskNumber = StringUtil.countSubString(podList, "project");
|
|
int taskNumber = StringUtil.countSubString(podList, "project");
|
|
if (StringUtil.isEmpty(lastNowString) && taskNumber == 0) {
|
|
if (StringUtil.isEmpty(lastNowString) && taskNumber == 0) {
|
|
redisTemplate.opsForValue().set(key, TimeUtil.getNowString());
|
|
redisTemplate.opsForValue().set(key, TimeUtil.getNowString());
|
|
@@ -121,7 +121,7 @@ public class TickScheduler {
|
|
while (true) {
|
|
while (true) {
|
|
log.info("TickScheduler-------checkProject 准备重启项目 " + projectId);
|
|
log.info("TickScheduler-------checkProject 准备重启项目 " + projectId);
|
|
String podList2 = SshUtil.execute(session, "kubectl get pod | grep project-" + projectId);
|
|
String podList2 = SshUtil.execute(session, "kubectl get pod | grep project-" + projectId);
|
|
- log.info("TickScheduler-------checkProject 项目 " + projectId + " 剩余的 pod 信息为:" + podList2);
|
|
|
|
|
|
+ log.info("TickScheduler-------checkProject 项目 " + projectId + " 剩余的 pod 信息为:\n" + podList2);
|
|
int taskNumber2 = StringUtil.countSubString(podList2, "project");
|
|
int taskNumber2 = StringUtil.countSubString(podList2, "project");
|
|
if (taskNumber2 == 0) {
|
|
if (taskNumber2 == 0) {
|
|
break;
|
|
break;
|