This is an automated email from the ASF dual-hosted git repository.
wangdan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pegasus.git
The following commit(s) were added to refs/heads/master by this push:
new 4a605825d fix(http_server): add deregister_http_call back (#1627)
4a605825d is described below
commit 4a605825def1b3f102dbd7d8196f3e9b80a0348a
Author: Yingchun Lai <[email protected]>
AuthorDate: Wed Sep 27 08:11:46 2023 -0500
fix(http_server): add deregister_http_call back (#1627)
https://github.com/apache/incubator-pegasus/issues/887
`deregister_http_call()` is defined but not declared in .h files,
this patch adds the declaration back and calls it in the desctructor
of class `replica_http_service`.
---
src/http/http_server.h | 2 ++
src/replica/replica_http_service.h | 9 ++++++++-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/http/http_server.h b/src/http/http_server.h
index b182947e4..c84055261 100644
--- a/src/http/http_server.h
+++ b/src/http/http_server.h
@@ -148,6 +148,8 @@ protected:
// ```
extern http_call ®ister_http_call(std::string full_path);
+extern void deregister_http_call(const std::string &full_path);
+
// Starts serving HTTP requests.
// The internal HTTP server will reuse the rDSN server port.
extern void start_http_server();
diff --git a/src/replica/replica_http_service.h
b/src/replica/replica_http_service.h
index d02707441..35b2352ac 100644
--- a/src/replica/replica_http_service.h
+++ b/src/replica/replica_http_service.h
@@ -48,7 +48,14 @@ public:
this,
std::placeholders::_1,
std::placeholders::_2),
- "ip:port/replica/maual_compaction?app_id=<app_id>");
+ "ip:port/replica/manual_compaction?app_id=<app_id>");
+ }
+
+ ~replica_http_service()
+ {
+ deregister_http_call("replica/duplication");
+ deregister_http_call("replica/data_version");
+ deregister_http_call("replica/manual_compaction");
}
std::string path() const override { return "replica"; }
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]