Merge claude/1

This commit is contained in:
librelad 2026-05-24 14:36:22 +01:00
commit 9ecb7e5f35

View File

@ -81,8 +81,17 @@ updateTaskFields() {
jqExpr="$jqExpr | .$key = \$$key"
done
# The processor runs as the manager user, which CANNOT create files in the
# docker-install-owned TASK_DIR. A plain `jq … > "$tmp"` redirect therefore
# failed silently, so neither `status: running` nor `status: completed` was
# ever written and the task was reprocessed forever. Capture jq's output and
# write the temp via runFileWrite (the privileged helper, like writeAtomic),
# then chmod + atomic mv as before.
local updated
updated=$(jq "${jqArgs[@]}" "$jqExpr" "$taskFile" 2>/dev/null) || return 1
[[ -z "$updated" ]] && return 1
local tmp="${taskFile}.tmp.$$"
jq "${jqArgs[@]}" "$jqExpr" "$taskFile" 2>/dev/null > "$tmp" \
printf '%s' "$updated" | runFileWrite "$tmp" \
&& runFileOp chmod 644 "$tmp" 2>/dev/null \
&& runFileOp mv "$tmp" "$taskFile"
}