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
parent
a753625fc6
commit
55ec3dbf51
|
|
@ -255,7 +255,7 @@ class _Cache:
|
||||||
try:
|
try:
|
||||||
await no_more_users.wait()
|
await no_more_users.wait()
|
||||||
finally:
|
finally:
|
||||||
value = cls.values.pop(ctx_key)
|
cls.values.pop(ctx_key)
|
||||||
cls.resources.pop(ctx_key)
|
cls.resources.pop(ctx_key)
|
||||||
|
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
|
|
@ -403,11 +403,6 @@ async def maybe_open_context(
|
||||||
resources = _Cache.resources
|
resources = _Cache.resources
|
||||||
entry: tuple|None = resources.get(ctx_key)
|
entry: tuple|None = resources.get(ctx_key)
|
||||||
if entry:
|
if entry:
|
||||||
(
|
|
||||||
service_tn,
|
|
||||||
ev,
|
|
||||||
ctx_exit,
|
|
||||||
) = entry
|
|
||||||
raise RuntimeError(
|
raise RuntimeError(
|
||||||
f'Caching resources ALREADY exist?!\n'
|
f'Caching resources ALREADY exist?!\n'
|
||||||
f'ctx_key={ctx_key!r}\n'
|
f'ctx_key={ctx_key!r}\n'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue