Skip to content

Commit

Permalink
Notice timeout faster
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerkaraszewski committed Feb 23, 2024
1 parent 86f4b43 commit 26a6529
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions sqlitecluster/SQLitePeer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ SQLitePeer::PeerPostPollStatus SQLitePeer::postPoll(fd_map& fdm, uint64_t& nextA
switch (socket->state.load()) {
case STCPManager::Socket::CONNECTED: {
// socket->lastRecvTime is always set, it's initialized to STimeNow() at creation.
auto lastActivityTime = max(socket->lastSendTime, socket->lastRecvTime);
if (lastActivityTime + SQLiteNode::RECV_TIMEOUT < STimeNow()) {
if (socket->lastRecvTime + SQLiteNode::RECV_TIMEOUT < STimeNow()) {
SHMMM("Connection with peer '" << name << "' timed out.");
return PeerPostPollStatus::SOCKET_ERROR;
}
Expand Down

0 comments on commit 26a6529

Please sign in to comment.