You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/08/12 04:35:39 UTC
[GitHub] [apisix] tzssangglass commented on a diff in pull request #7648: fix: use a new way to manage clean_handler
tzssangglass commented on code in PR #7648:
URL: https://github.com/apache/apisix/pull/7648#discussion_r944106494
##########
apisix/core/config_util.lua:
##########
@@ -56,23 +58,56 @@ end
-- or cancelled. Note that Nginx worker exit doesn't trigger the clean handler.
-- Return an index so that we can cancel it later.
function _M.add_clean_handler(item, func)
- local idx = #item.clean_handlers + 1
- item.clean_handlers[idx] = func
- return idx
+ if not item.clean_handlers._id then
+ item.clean_handlers._id = 1
+ end
+
+ local id = item.clean_handlers._id
+ item.clean_handlers._id = item.clean_handlers._id + 1
Review Comment:
What is the `clean_handlers._id` used for?
--
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: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org