1
0
Fork 0
mirror of https://github.com/dragonflydb/dragonfly.git synced 2024-12-15 17:51:06 +00:00

fix: macos segfault loading snapshot (#1931)

This commit is contained in:
Andy Dunstall 2023-09-26 07:39:13 +01:00 committed by GitHub
parent 00ee506cc8
commit d9f4ca8003
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -250,7 +250,12 @@ bool IsReplicatingNoOne(string_view host, string_view port) {
}
void RebuildAllSearchIndices(Service* service) {
boost::intrusive_ptr<Transaction> trans{new Transaction{service->FindCmd("FT.CREATE")}};
const CommandId* cmd = service->FindCmd("FT.CREATE");
if (cmd == nullptr) {
// On MacOS we don't include search so FT.CREATE won't exist.
return;
}
boost::intrusive_ptr<Transaction> trans{new Transaction{cmd}};
trans->InitByArgs(0, {});
trans->ScheduleSingleHop([](auto* trans, auto* es) {
es->search_indices()->RebuildAllIndices(trans->GetOpArgs(es));