wwbmmm commented on code in PR #2610:
URL: https://github.com/apache/brpc/pull/2610#discussion_r1575911958


##########
src/brpc/span.cpp:
##########
@@ -506,6 +509,12 @@ inline uint64_t ToLittleEndian(const uint32_t* buf) {
 }
 
 SpanDB* SpanDB::Open() {
+    // Remove old rpcz directory even if crash occurs.
+    if (!FLAGS_rpcz_keep_span_db) {
+        std::string cmd = butil::string_printf("rm -rf %s", 
FLAGS_rpcz_database_dir.c_str());

Review Comment:
   这样操作会不会太危险了,万一 FLAGS_rpcz_database_dir 被设置成 / 之类的。
   是不是可以遍历下目录,删除里面的id.db和time.db文件就可以



-- 
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: dev-unsubscr...@brpc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org
For additional commands, e-mail: dev-h...@brpc.apache.org

Reply via email to