[ server ] [ status ]- fix bug - 1

This commit is contained in:
zeaslity
2023-02-02 17:00:51 +08:00
parent 2fe8b8526f
commit 0bd0c9da53
2 changed files with 8 additions and 15 deletions

View File

@@ -2,6 +2,7 @@ package io.wdd.rpc.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.wdd.common.beans.response.R;
import io.wdd.rpc.execute.result.BuildStreamReader;
import io.wdd.rpc.execute.service.CoreExecutionService;
@@ -16,7 +17,6 @@ import javax.annotation.Resource;
import java.util.List;
import static io.wdd.rpc.execute.result.RedisStreamReaderConfig.AGENT_STATUS_REDIS_STREAM_LISTENER_CONTAINER;
import static io.wdd.rpc.execute.result.RedisStreamReaderConfig.COMMAND_RESULT_REDIS_STREAM_LISTENER_CONTAINER;
@RestController
@RequestMapping("/octopus/server/executor")
@@ -31,6 +31,7 @@ public class ExecutionController {
@PostMapping("command")
@ApiOperation("[命令]-手动发送命令")
public R<String> patchCommandToAgent(
@RequestParam(value = "topicName") String topicName,
@RequestParam(value = "commandList", required = false) @Nullable List<String> commandList,
@@ -55,21 +56,11 @@ public class ExecutionController {
return R.ok(streamKey);
}
@PostMapping("/stream")
public void GetCommandLog(
@RequestParam(value = "streamKey") String streamKey
) {
buildStreamReader.registerStreamReader(
COMMAND_RESULT_REDIS_STREAM_LISTENER_CONTAINER,
streamKey
);
}
@PostMapping("/agentStatusStream")
public void getAgentStatus(
@RequestParam(value = "streamKey") String streamKey
@ApiOperation("切换Console查看Agent状态日志")
public R<String> getAgentStatusStrem(
@RequestParam(value = "streamKey") @ApiParam(value = "status的Stream Key") String streamKey
) {
buildStreamReader.registerStreamReader(
@@ -77,6 +68,8 @@ public class ExecutionController {
streamKey
);
return R.ok("请到控制台查看,已经切换至 => " + streamKey);
}

View File

@@ -87,7 +87,7 @@ public class CoreExecutionServiceImpl implements CoreExecutionService {
String resultKey = futureKey;
// 判定是否是 FutureKey
if (StringUtils.isEmpty(agentTopicName)) {
if (null == futureKey) {
resultKey = ExecutionMessage.GetResultKey(agentTopicName);
}