Skip to content

Commit

Permalink
hot fix for python build (#383)
Browse files Browse the repository at this point in the history
  • Loading branch information
yashpatel007 authored Jun 27, 2023
1 parent 0c71838 commit 2b50d8e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions include/index.h
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ template <typename T, typename TagT = uint32_t, typename LabelT = uint32_t> clas
bool _dynamic_index = false;
bool _enable_tags = false;
bool _normalize_vecs = false; // Using normalied L2 for cosine.
bool _deletes_enabled = false;

// Filter Support

Expand Down
7 changes: 6 additions & 1 deletion src/index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2440,6 +2440,11 @@ template <typename T, typename TagT, typename LabelT> int Index<T, TagT, LabelT>
return -2;
}

if (this->_deletes_enabled)
{
return 0;
}

std::unique_lock<std::shared_timed_mutex> ul(_update_lock);
std::unique_lock<std::shared_timed_mutex> tl(_tag_lock);
std::unique_lock<std::shared_timed_mutex> dl(_delete_lock);
Expand All @@ -2451,7 +2456,7 @@ template <typename T, typename TagT, typename LabelT> int Index<T, TagT, LabelT>
_empty_slots.insert(slot);
}
}

this->_deletes_enabled = true;
return 0;
}

Expand Down

0 comments on commit 2b50d8e

Please sign in to comment.