Skip to content

Commit 9c6824f

Browse files
Clean up comment per feedback
1 parent 7348afc commit 9c6824f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/Client.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -703,10 +703,9 @@ private function receiveResponse()
703703
}
704704
} while (is_null($responseLength) || strlen($response) < $responseLength);
705705

706-
// We save the commitCount for future requests. This is useful if for some reason we change the bedrock node we
707-
// are talking to.
708-
// We only set it if process time was returned, which means we did a write. We don't care about saving the commit
709-
// count for reads, since we did not change anything in the DB.
706+
// Save the commit count if needed.
707+
// In some cases, Auth will return a header instructing the client to save the commit count. It is useful for determining if stale data was used for certain read commands.
708+
// Commit counts are saved for all write commands, identified by process time being non-zero, because it can be useful for future requests if for some reason we change the bedrock node we are talking to.
710709
if ($responseHeaders['shouldSaveCommitCount'] ?? false || (isset($responseHeaders['commitCount']) && (($responseHeaders['processTime'] ?? 0) > 0 || ($responseHeaders['upstreamProcessTime'] ?? 0) > 0))) {
711710
$this->commitCount = (int) ($responseHeaders['commitCount'] ?? 0);
712711
}

0 commit comments

Comments
 (0)