Skip to content

Commit

Permalink
fixed some errors
Browse files Browse the repository at this point in the history
  • Loading branch information
a00817524 authored and JohnSully committed Nov 17, 2023
1 parent de73b2c commit 4818ddf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/storage/rocksdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ void RocksDBStorageProvider::endWriteBatch()

struct BatchStorageToken : public StorageToken {
std::shared_ptr<rocksdb::DB> tspdb; // Note: This must be first so it is deleted last
std::unique_ptr<rocksdb::WriteBatch> tspbatch;
std::unique_ptr<rocksdb::WriteBatchWithIndex> tspbatch;
~BatchStorageToken(){
tspdb.reset();
tspdb = nullptr;
Expand All @@ -273,7 +273,7 @@ StorageToken* RocksDBStorageProvider::begin_endWriteBatch(struct aeEventLoop *el
m_spbatch = nullptr;
m_lock.unlock();
(*m_pfactory->m_wqueue)->AddWorkFunction([this, el,callback,tok]{
tok->tspdb->Write(WriteOptions(),tok->tspbatch.get());
tok->tspdb->Write(WriteOptions(),tok->tspbatch.get()->GetWriteBatch());
aePostFunction(el,callback,tok);
});

Expand Down Expand Up @@ -322,7 +322,7 @@ StorageToken *RocksDBStorageProvider::begin_retrieve(struct aeEventLoop *el, aeP
}

auto opts = ReadOptions();
opts.async_io = true;
//opts.async_io = true;
(*m_pfactory->m_wqueue)->AddWorkFunction([this, el, callback, tok, opts]{
std::vector<std::string> veckeysStr;
std::vector<rocksdb::Slice> veckeys;
Expand Down Expand Up @@ -362,4 +362,4 @@ void RocksDBStorageProvider::complete_retrieve(StorageToken *tok, callbackSingle
}
}
delete rtok;
}
}

0 comments on commit 4818ddf

Please sign in to comment.