Skip to content

Commit 70bac27

Browse files
committed
add some docs
1 parent 6f63613 commit 70bac27

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/service-library/src/servicelib/redis/_semaphore.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,8 @@ async def _periodic_reacquisition(
476476
)
477477
await auto_reacquisition_started.wait()
478478
try:
479+
# NOTE: this try/finally ensures that cancellation_event is set when we exit the context
480+
# even in case of exceptions
479481
yield semaphore
480482
finally:
481483
cancellation_event.set() # NOTE: this ensure cancellation is effective

0 commit comments

Comments
 (0)