We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 907ffbc commit 9c0c54bCopy full SHA for 9c0c54b
pymongo/_csot.py
@@ -67,7 +67,11 @@ def remaining() -> Optional[float]:
67
68
@contextlib.contextmanager
69
def reset() -> Generator:
70
- deadline_token = DEADLINE.set(DEADLINE.get() + get_timeout()) # type: ignore[operator]
+ timeout = get_timeout()
71
+ if timeout is None:
72
+ deadline_token = DEADLINE.set(DEADLINE.get())
73
+ else:
74
+ deadline_token = DEADLINE.set(DEADLINE.get() + timeout) # type: ignore[operator]
75
yield
76
DEADLINE.reset(deadline_token)
77
0 commit comments