Redis: Force storage sync mode when reading pcaps, default to async mode

This commit is contained in:
Tim Wojtulewicz 2024-12-17 16:20:25 -07:00
parent 31e146b16d
commit 52d94b781a
2 changed files with 4 additions and 2 deletions

View file

@ -88,7 +88,9 @@ storage::BackendPtr Redis::Instantiate(std::string_view tag) { return make_intru
* with a corresponding message.
*/
ErrorResult Redis::DoOpen(RecordValPtr options) {
async_mode = options->GetField<BoolVal>("async_mode")->Get();
// When reading traces we disable storage async mode globally (see src/storage/Backend.cc) since
// time moves forward based on the pcap and not based on real time.
async_mode = options->GetField<BoolVal>("async_mode")->Get() && ! zeek::run_state::reading_traces;
key_prefix = options->GetField<StringVal>("key_prefix")->ToStdString();
redisOptions opt = {0};