fix: use output redirect instead of --log-file in Codex nodes

This commit is contained in:
gmega 2025-06-27 19:12:17 -03:00
parent 29a39369eb
commit 3e8b019d6b
No known key found for this signature in database
GPG Key ID: 6290D34EAD824B18
3 changed files with 4 additions and 7 deletions

View File

@ -1,5 +1,4 @@
#!/usr/bin/env bash
LIB_SRC=${LIB_SRC:-$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)}
PROM_TARGETS_DIR=${PROM_TARGETS_DIR:-"${LIB_SRC}/../dashboard/targets/"}

View File

@ -117,8 +117,8 @@ cdx_cmdline() {
# shellcheck disable=SC2140
echo "${cdx_cmd}"\
" --log-file=${_cdx_logs}/codex-${node_index}.log --data-dir=${_cdx_data}/codex-${node_index}"\
" --api-port=$(_cdx_api_port "$node_index") --disc-port=$(_cdx_disc_port "$node_index") --log-level=INFO"
"--data-dir=${_cdx_data}/codex-${node_index} --api-port=$(_cdx_api_port "$node_index")"\
"--disc-port=$(_cdx_disc_port "$node_index") --log-level=INFO"
}
cdx_get_spr() {
@ -145,7 +145,7 @@ cdx_launch_node() {
cmd_array=()
IFS=' ' read -r -a cmd_array <<<"$codex_cmd"
pm_async "bash" "-c" "exec ${cmd_array[*]} &> /dev/null" -%- "codex" "${node_index}"
pm_async "bash" "-c" "exec ${cmd_array[*]} &> ${_cdx_logs}/codex-${node_index}.log" -%- "codex" "${node_index}"
_cdx_pids[$node_index]=$!
cdx_ensure_ready "$node_index"

View File

@ -14,7 +14,6 @@ setup() {
@test "should generate the correct Codex command line for node 0" {
# shellcheck disable=SC2140
assert_equal "$(cdx_cmdline 0)" "${_cdx_binary} --nat:none"\
" --log-file=${_cdx_output}/logs/codex-0.log"\
" --data-dir=${_cdx_output}/data/codex-0"\
" --api-port=8080 --disc-port=8190 --log-level=INFO"
}
@ -22,7 +21,7 @@ setup() {
@test "should generate the correct Codex command line for node 1" {
# shellcheck disable=SC2140
assert_equal "$(cdx_cmdline 1 '--bootstrap-node' 'node-spr')" "${_cdx_binary} --nat:none"\
" --bootstrap-node=node-spr --log-file=${_cdx_output}/logs/codex-1.log"\
" --bootstrap-node=node-spr"\
" --data-dir=${_cdx_output}/data/codex-1"\
" --api-port=8081 --disc-port=8191 --log-level=INFO"
}
@ -36,7 +35,6 @@ setup() {
# shellcheck disable=SC2140
assert_equal "$(cdx_cmdline 0 --metrics)" "${_cdx_binary} --nat:none"\
" --metrics --metrics-port=8290 --metrics-address=0.0.0.0"\
" --log-file=${_cdx_output}/logs/codex-0.log"\
" --data-dir=${_cdx_output}/data/codex-0"\
" --api-port=8080 --disc-port=8190 --log-level=INFO"
}