s/b: poll for session directory after creation
FUSE entry cache may not reflect the new session directory immediately after the write to s/new returns. Poll until it appears, mirroring the approach in s/sh. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
00155f28fc
commit
9e26eb0375
|
|
@ -89,6 +89,11 @@ backend=${backend}"
|
|||
model=${model}"
|
||||
printf '%s\n' "$kv" > "$MOUNT/s/new" || die "failed to create session"
|
||||
|
||||
# Poll until the session directory is visible (FUSE entry cache may lag).
|
||||
local deadline=$(( $(date +%s) + 5 ))
|
||||
until [ -d "$B" ] || [ "$(date +%s)" -ge "$deadline" ]; do sleep 0.05; done
|
||||
[ -d "$B" ] || die "timeout waiting for session $id"
|
||||
|
||||
printf '%s\n' "$prompt" > "$B/prompt" || die "failed to submit prompt"
|
||||
|
||||
if [ "$bg" -eq 1 ]; then
|
||||
|
|
|
|||
Loading…
Reference in New Issue