Skip to content

Commit

Permalink
feat(request-debugging): fix a lua bug that cause fields in root_cont…
Browse files Browse the repository at this point in the history
…ext disappear
  • Loading branch information
Oyami-Srk committed Sep 23, 2024
1 parent 9854a64 commit 0e08253
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kong/timing/context.lua
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ function _M:finalize(subcontext)
end


function _M:get_total_time_without_upstream()
function _M:get_total_time_without_upstream(context)
local total_time = 0
for k, child in pairs(self.root_context.child) do
for k, child in pairs(context.child) do
if k ~= "upstream" and child.total_time then
total_time = total_time + child.total_time
end
Expand All @@ -120,7 +120,7 @@ function _M:to_json()

self:set_root_context_prop("dangling", dangling)
self:finalize(self.root_context)
self.root_context.total_time_without_upstream = self:get_total_time_without_upstream()
self.root_context.total_time_without_upstream = self:get_total_time_without_upstream(self.root_context)
return assert(cjson.encode(self.root_context))
end

Expand Down

0 comments on commit 0e08253

Please sign in to comment.