Skip to content

Commit

Permalink
avoid push when evicting
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelSze1 committed Aug 16, 2024
1 parent b5b97e7 commit 64fc4de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pikiwidb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ void PikiwiDB::ScanEvictedBlockedConnsOfBlrpop() {
for (auto& it : key_to_blocked_conns) {
auto& conns_list = it.second;
for (auto conn_node = conns_list->begin(); conn_node != conns_list->end();) {
if (conn_node->is_done_->load()) {
if (conn_node->is_done_->exchange(true)) {
conn_node = conns_list->erase(conn_node);
} else if (conn_node->IsExpired()) {
PClient* conn_ptr = conn_node->GetBlockedClient();
Expand Down

0 comments on commit 64fc4de

Please sign in to comment.