Skip to content

Commit fbb76d1

Browse files
committed
Attempt to cancel future if applicable, deal with multiple _sync_state calls
1 parent 0c7f870 commit fbb76d1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pinecone/grpc/future.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ def _sync_state(self, grpc_future):
3030
if self.done():
3131
return
3232

33-
if grpc_future.running():
34-
self.set_running_or_notify_cancel()
33+
if grpc_future.running() and not self.running():
34+
if not self.set_running_or_notify_cancel():
35+
grpc_future.cancel()
3536
elif grpc_future.cancelled():
3637
self.cancel()
3738
elif grpc_future.done():

0 commit comments

Comments
 (0)