Skip to content

Commit

Permalink
remove old rpcz directory even if program crash
Browse files Browse the repository at this point in the history
  • Loading branch information
yanglimingcn committed Apr 22, 2024
1 parent bbd88a8 commit e2e5e49
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/brpc/span.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,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());
butil::ignore_result(system(cmd.c_str()));
}

SpanDB local;
leveldb::Status st;
char prefix[64];
Expand Down

0 comments on commit e2e5e49

Please sign in to comment.