Drop unused `_Cache` teardown bindings

Remove the unused `value` assignment after cache eviction and skip
unpacking stale resource state before raising its invariant error.

Review: PR #488 (Copilot)
https://github.com/goodboy/tractor/pull/488#pullrequestreview-4850557500

(this patch was generated in some part by `opencode` using
`gpt-5.6-sol` (`openai`))
wkt/moc_teardown_completion
Gud Boi 2026-08-07 22:24:27 -04:00
parent a753625fc6
commit 55ec3dbf51
1 changed files with 1 additions and 6 deletions

View File

@ -255,7 +255,7 @@ class _Cache:
try:
await no_more_users.wait()
finally:
value = cls.values.pop(ctx_key)
cls.values.pop(ctx_key)
cls.resources.pop(ctx_key)
except Exception as exc:
@ -403,11 +403,6 @@ async def maybe_open_context(
resources = _Cache.resources
entry: tuple|None = resources.get(ctx_key)
if entry:
(
service_tn,
ev,
ctx_exit,
) = entry
raise RuntimeError(
f'Caching resources ALREADY exist?!\n'
f'ctx_key={ctx_key!r}\n'