Skip to content

Commit 6d12ad7

Browse files
committed
chore(wp): fix comments
Signed-off-by: Gil Levkovich <[email protected]>
1 parent e6d331f commit 6d12ad7

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/facade/dragonfly_connection.cc

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,15 +1144,12 @@ Connection::ParserStatus Connection::ParseRedis(unsigned max_busy_cycles) {
11441144
size_t total_consumed = 0;
11451145

11461146
do {
1147-
static thread_local uint32_t shrink_counter{};
1148-
static constexpr uint32_t kShrinkInterval = 0x3F; // every 64 calls
1149-
if ((++shrink_counter & kShrinkInterval) == 0) {
1150-
ShrinkPipelinePool();
1151-
}
1152-
11531147
if (parsed_cmd_ == nullptr) {
1154-
// Gradually release pipeline request pool. Run only ONCE per command.
1155-
ShrinkPipelinePool();
1148+
static thread_local uint32_t shrink_counter{};
1149+
static constexpr uint32_t kShrinkInterval = 0x3F; // every 64 commands
1150+
if ((++shrink_counter & kShrinkInterval) == 0) {
1151+
ShrinkPipelinePool();
1152+
}
11561153

11571154
PipelineMessagePtr ptr = GetFromPoolOrCreate();
11581155
parsed_cmd_ = ptr.release();
@@ -1908,7 +1905,7 @@ void Connection::SendAsync(MessageHandle msg) {
19081905
dispatch_q_.push_back(std::move(msg));
19091906
}
19101907

1911-
// Don't notify if a sync dispatch is in progress, it will wake after finishing.
1908+
// Only notify if the queue was previously empty (consumer might be waiting)
19121909
if (dispatch_q_.size() == 1) {
19131910
cnd_.notify_one();
19141911
}

0 commit comments

Comments
 (0)