tzssangglass commented on code in PR #7036:
URL: https://github.com/apache/apisix/pull/7036#discussion_r871976627
##########
apisix/stream/xrpc/runner.lua:
##########
@@ -27,6 +27,19 @@ local pcall = pcall
local ipairs = ipairs
local tostring = tostring
+
+core.ctx.register_var("rpc_time", function(ctx)
+ local session = ctx.xrpc_session
+ local curr_ctx_id = session._currr_ctx_id
+ local curr_ctx = session._ctxs[curr_ctx_id]
Review Comment:
due
to:https://github.com/apache/apisix/blob/4690feb421779f5b79e8dd990dc00f4d3f1052d0/apisix/core/ctx.lua#L345
in `core.ctx.register_var`, the `ctx.var._ctx` would point to
`ngx.ctx.api_ctx`, so I choose to pass th xRPC ctx in `session._curr_ctx`
--
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]