For claude, ignore no runtime for offline shm reading

multiaddrs
Gud Boi 2026-01-29 02:49:25 -05:00
parent 8718ad4874
commit f11ab5f0aa
1 changed files with 10 additions and 4 deletions

View File

@ -520,9 +520,12 @@ def open_shm_array(
# "unlink" created shm on process teardown by
# pushing teardown calls onto actor context stack
stack = tractor.current_actor().lifetime_stack
stack.callback(shmarr.close)
stack.callback(shmarr.destroy)
stack = tractor.current_actor(
err_on_no_runtime=False,
).lifetime_stack
if stack:
stack.callback(shmarr.close)
stack.callback(shmarr.destroy)
return shmarr
@ -607,7 +610,10 @@ def attach_shm_array(
_known_tokens[key] = token
# "close" attached shm on actor teardown
tractor.current_actor().lifetime_stack.callback(sha.close)
if (actor := tractor.current_actor(
err_on_no_runtime=False,
)):
actor.lifetime_stack.callback(sha.close)
return sha