Skip to content

Commit

Permalink
fix: rename method to reflect request is not initial only
Browse files Browse the repository at this point in the history
  • Loading branch information
crwilcox committed Jan 31, 2020
1 parent 19a7e59 commit a6558a5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions firestore/google/cloud/firestore_v1/watch.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def __init__(

self.resume_token = None

initial_request = self._get_initial_request
rpc_request = self._get_rpc_request

if ResumableBidiRpc is None:
ResumableBidiRpc = self.ResumableBidiRpc # FBO unit tests
Expand All @@ -224,7 +224,7 @@ def __init__(
self._api.transport.listen,
should_recover=_should_recover,
should_terminate=_should_terminate,
initial_request=initial_request,
initial_request=rpc_request,
metadata=self._firestore._rpc_metadata,
)

Expand Down Expand Up @@ -258,7 +258,7 @@ def __init__(
self._consumer = BackgroundConsumer(self._rpc, self.on_snapshot)
self._consumer.start()

def _get_initial_request(self):
def _get_rpc_request(self):
if self.resume_token is not None:
self._targets["resume_token"] = self.resume_token
return firestore_pb2.ListenRequest(
Expand Down Expand Up @@ -578,6 +578,7 @@ def push(self, read_time, next_resume_token):
self.change_map.clear()
self.resume_token = next_resume_token


@staticmethod
def _extract_changes(doc_map, changes, read_time):
deletes = []
Expand Down Expand Up @@ -734,6 +735,7 @@ def _reset_docs(self):
self.change_map.clear()
self.resume_token = None


# Mark each document as deleted. If documents are not deleted
# they will be sent again by the server.
for snapshot in self.doc_tree.keys():
Expand Down

0 comments on commit a6558a5

Please sign in to comment.