修复集群推流BUG

This commit is contained in:
lin
2025-05-23 18:06:54 +08:00
parent 55f36f660b
commit 601d2b5d2b
4 changed files with 14 additions and 5 deletions

View File

@@ -181,7 +181,8 @@ public class RedisRpcStreamPushController extends RpcController {
*/
@RedisRpcMapping("play")
public RedisRpcResponse play(RedisRpcRequest request) {
int id = Integer.parseInt(request.getParam().toString());
JSONObject paramJson = JSONObject.parseObject(request.getParam().toString());
int id = paramJson.getInteger("id");
RedisRpcResponse response = request.getResponse();
if (id <= 0) {
response.setStatusCode(ErrorCode.ERROR400.getCode());

View File

@@ -194,7 +194,9 @@ public class RedisRpcPlayServiceImpl implements IRedisRpcPlayService {
@Override
public void playPush(String serverId, Integer id, ErrorCallback<StreamInfo> callback) {
RedisRpcRequest request = buildRequest("streamPush/play", id + "");
JSONObject jsonObject = new JSONObject();
jsonObject.put("id", id);
RedisRpcRequest request = buildRequest("streamPush/play", jsonObject);
request.setToId(serverId);
RedisRpcResponse response = redisRpcConfig.request(request, userSetting.getPlayTimeout(), TimeUnit.SECONDS);
if (response == null) {