Merge pull request #217 from pikers/hot_fix_cache_event_is_none

Only set event if entry still exists
pause_feeds_on_sym_switch
goodboy 2021-09-02 12:52:27 -04:00 committed by GitHub
commit 07e35d3ff5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -174,8 +174,10 @@ async def maybe_open_ctx(
log.warning(f'De-allocating resource for {key}') log.warning(f'De-allocating resource for {key}')
# terminate mngr nursery # terminate mngr nursery
_, no_more_users = cache.resources[ctx_key] entry = cache.resources.get(ctx_key)
no_more_users.set() if entry:
_, no_more_users = entry
no_more_users.set()
@asynccontextmanager @asynccontextmanager