tzssangglass commented on code in PR #7041:
URL: https://github.com/apache/apisix/pull/7041#discussion_r873527350
##########
apisix/stream/xrpc/protocols/redis/init.lua:
##########
@@ -31,6 +31,15 @@ local ipairs = ipairs
local tonumber = tonumber
+core.ctx.register_var("redis_cmd_line", function(ctx)
+ local curr_ctx = ctx.xrpc_session and ctx.xrpc_session._curr_ctx
+ if not curr_ctx then
+ core.log.warn("can't find current context")
+ return nil
+ end
+ return curr_ctx.cmd
Review Comment:
> as this var is used in the log.
No, cmd_line is also used for filter, filter would be weird to write if it
returned a spliced cmd_line.
cmd_line in array maybe like:
```
{ "hmget", "animals", "dog", "cat" },
```
cmd_line in string maybe like:
```
"hmget animals dog cat"
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]