Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston authored Oct 27, 2023
1 parent b43fc5e commit 78bdba5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions synapse/replication/tcp/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,13 +611,13 @@ async def _process_position(
# Find where we previously streamed up to.
current_token = stream.current_token(cmd.instance_name)

# If the position token matches our current token then we're up to date
# and there's nothing to do. Otherwise, fetch all updates between then
# and now.
# If the incoming previous position is less than our current position
# then we're up to date and there's nothing to do. Otherwise, fetch
# all updates between then and now.
#
# Note: We have to check that `current_token` is within the range, to
# handle the case where the stream gets "reset" (e.g. for `caches` and
# `typing` after the writer's restart).
# Note: We also have to check that `current_token` is at least the
# new position, to handle the case where the stream gets "reset"
# (e.g. for `caches` and `typing` after the writer's restart).
missing_updates = not (cmd.prev_token <= current_token <= cmd.new_token)
while missing_updates:
# Note: There may very well not be any new updates, but we check to
Expand Down

0 comments on commit 78bdba5

Please sign in to comment.