starsz commented on code in PR #10905:
URL: https://github.com/apache/apisix/pull/10905#discussion_r1480857843
##########
docs/en/latest/control-api.md:
##########
@@ -475,3 +475,9 @@ Dumps the metadata with the specified `plugin_name`:
"id": "file-logger"
}
```
+
+### POST /v1/plugins_reload
+
+Introduced in [v3.9.0](https://github.com/apache/apisix/releases/tag/3.9.0)
+
+Triggers a hot reload of the plugins.
Review Comment:
Can you give an example of how to use this API?
##########
apisix/control/v1.lua:
##########
@@ -474,5 +485,12 @@ return {
uris = {"/plugin_metadata/*"},
handler = _M.dump_plugin_metadata,
},
+ -- /v1/plugins_reload
+ {
+ methods = {"PUT"},
+ uris = {"/plugins_reload"},
Review Comment:
```suggestion
uris = {"/plugins/reload"},
```
Would be better.
##########
docs/en/latest/control-api.md:
##########
@@ -475,3 +475,9 @@ Dumps the metadata with the specified `plugin_name`:
"id": "file-logger"
}
```
+
+### POST /v1/plugins_reload
Review Comment:
The method is `PUT` right?
##########
apisix/control/router.lua:
##########
@@ -46,6 +47,80 @@ local function format_dismod_uri(mod_name, uri)
return core.table.concat(tmp, "")
end
+local function plugins_eq(old, new)
+ local old_set = {}
+ for _, p in ipairs(old) do
+ old_set[p.name] = p
+ end
+
+ local new_set = {}
+ for _, p in ipairs(new) do
+ new_set[p.name] = p
+ end
+
+ return core.table.set_eq(old_set, new_set)
+end
+
+local function sync_local_conf_to_etcd(reset)
Review Comment:
The code is the same as it is under admin API. Why not put it into the utils
directory?
--
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]