Skip to content

Commit

Permalink
MOD: add detect delete error
Browse files Browse the repository at this point in the history
  • Loading branch information
karelrooted committed Aug 22, 2019
1 parent 4a563d5 commit 074e968
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/redis_db.cc
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,11 @@ rocksdb::Status Database::FlushDB() {
for (iter->Seek(prefix);
iter->Valid() && iter->key().starts_with(prefix);
iter->Next()) {
db_->Delete(rocksdb::WriteOptions(), metadata_cf_handle_, iter->key());
auto s = db_->Delete(rocksdb::WriteOptions(), metadata_cf_handle_, iter->key());
if (!s.ok()) {
delete iter;
return s;
}
}
delete iter;
return rocksdb::Status::OK();
Expand Down

0 comments on commit 074e968

Please sign in to comment.