Merge claude/1
This commit is contained in:
commit
9ecb7e5f35
@ -81,8 +81,17 @@ updateTaskFields() {
|
|||||||
jqExpr="$jqExpr | .$key = \$$key"
|
jqExpr="$jqExpr | .$key = \$$key"
|
||||||
done
|
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.$$"
|
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 chmod 644 "$tmp" 2>/dev/null \
|
||||||
&& runFileOp mv "$tmp" "$taskFile"
|
&& runFileOp mv "$tmp" "$taskFile"
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user