Skip to content

Commit

Permalink
Update SQLiteNode.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
danieldoglas authored Dec 23, 2024
1 parent 6f5596f commit 2d02306
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sqlitecluster/SQLiteNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1283,7 +1283,7 @@ void SQLiteNode::_onMESSAGE(SQLitePeer* peer, const SData& message) {
// represents ~30s of commits. If we're behind, let's close the command port
// so we can catch up with the cluster before processing new commands.
const string blockReason = "COMMITS_LAGGING_BEHIND";
const int64_t currentCommitDifference = getCommitCount() - peer->commitCount;
const int64_t currentCommitDifference = peer->commitCount - getCommitCount();
if (peer == _leadPeer && currentCommitDifference >= 12'500 && !_blockedCommandPort) {
SINFO("Node is lagging behind, closing command port so it can catch up.");
_server.blockCommandPort(blockReason);
Expand Down

0 comments on commit 2d02306

Please sign in to comment.