From 0e31f8eeef68546a8771667fe422cee02145eb10 Mon Sep 17 00:00:00 2001 From: BradLee Date: Tue, 20 Jul 2021 18:16:26 +0800 Subject: [PATCH] Fix the SUBSCRIBE command can't the update last interaction time (#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. --- src/worker.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/worker.cc b/src/worker.cc index 2ce4dc41f0c..e1813f83d79 100644 --- a/src/worker.cc +++ b/src/worker.cc @@ -234,6 +234,7 @@ Status Worker::Reply(int fd, const std::string &reply) { std::unique_lock lock(conns_mu_); auto iter = conns_.find(fd); if (iter != conns_.end()) { + iter->second->SetLastInteraction(); Redis::Reply(iter->second->Output(), reply); return Status::OK(); }