diff --git a/pinecone/grpc/future.py b/pinecone/grpc/future.py index d98e1e84..2a4ae7c6 100644 --- a/pinecone/grpc/future.py +++ b/pinecone/grpc/future.py @@ -30,18 +30,16 @@ def _sync_state(self, grpc_future): if self.done(): return - if grpc_future.cancelled(): + if grpc_future.running(): + self.set_running_or_notify_cancel() + elif grpc_future.cancelled(): self.cancel() - elif grpc_future.exception(timeout=self._default_timeout): - self.set_exception(grpc_future.exception()) elif grpc_future.done(): try: result = grpc_future.result(timeout=self._default_timeout) self.set_result(result) except Exception as e: self.set_exception(e) - elif grpc_future.running(): - self.set_running_or_notify_cancel() def set_result(self, result): if self._result_transformer: