Skip to content

Commit

Permalink
Fix the SUBSCRIBE command can't the update last interaction time (apa…
Browse files Browse the repository at this point in the history
…che#335)

Act like Redis, SUBSCRIBE must update the last interaction time while a publish message received, otherwise, this channel may be closed for timeout reasons by default.
  • Loading branch information
smartlee authored and ShooterIT committed Sep 9, 2021
1 parent a01c8f5 commit 0e31f8e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/worker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ Status Worker::Reply(int fd, const std::string &reply) {
std::unique_lock<std::mutex> lock(conns_mu_);
auto iter = conns_.find(fd);
if (iter != conns_.end()) {
iter->second->SetLastInteraction();
Redis::Reply(iter->second->Output(), reply);
return Status::OK();
}
Expand Down

0 comments on commit 0e31f8e

Please sign in to comment.