spacewander commented on a change in pull request #4559:
URL: https://github.com/apache/apisix/pull/4559#discussion_r667565558
##########
File path: apisix/plugins/request-id.lua
##########
@@ -65,4 +191,47 @@ function _M.header_filter(conf, ctx)
end
end
+function _M.init()
+ local local_conf = core.config.local_conf()
+ attr = core.table.try_read_attr(local_conf, "plugin_attr", plugin_name)
+ local ok, err = core.schema.check(attr_schema, attr)
+ if not ok then
+ core.log.error("failed to check the plugin_attr[", plugin_name, "]",
": ", err)
+ return
+ end
+ if attr.snowflake.enable then
+ if process.type() == "worker" then
+ ngx.timer.at(0, next_id)
+ end
+ end
+end
+
+function _M.api()
Review comment:
Let's make it optional and submit it in the next PR. This one is already
big enough.
--
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]