Skip to content

Commit

Permalink
Update run.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangmy21 authored May 11, 2024
1 parent 5a2f807 commit 1339067
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions dependency/shell/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ fi

function retry_command {
local command="$1"
local max_attempts=10
local max_attempts=5
local attempt_num=1
local sleep_seconds=5
local sleep_seconds=10

while [ $attempt_num -le $max_attempts ]; do
echo "Attempt $attempt_num / $max_attempts to run command: $command"
Expand Down Expand Up @@ -130,11 +130,11 @@ elif [ "$TERMINAL" = "CLIENT" ]; then
cp -r $python_main_dir $python_main_dir$i
cp -f ./$code_name.py $python_main_dir$i/PyAPI/AI.py
command="nice -0 python3 $python_main_dir$i/PyAPI/main.py -I $CONNECT_IP -P $PORT -t $k -p $i > $playback_dir/team$k-$code_name.log 2>&1 &"
retry_command "$command" > $playback_dir/client$k.log &
retry_command "$command" > $playback_dir/client$k-$i.log &
elif [ -f "./$code_name" ]; then
echo "find ./$code_name"
command="nice -0 ./$code_name -I $CONNECT_IP -P $PORT -t $k -p $i > $playback_dir/team$k-$codename.log 2>&1 &"
retry_command "$command" > $playback_dir/client$k.log &
command="nice -0 ./$code_name -I $CONNECT_IP -P $PORT -t $k -p $i > $playback_dir/team$k-$code_name.log 2>&1 &"
retry_command "$command" > $playback_dir/client$k-$i.log &
else
echo "ERROR. $code_name is not found."
fi
Expand All @@ -145,11 +145,11 @@ elif [ "$TERMINAL" = "CLIENT" ]; then
cp -r $python_main_dir $python_main_dir$i
cp -f ./$code_name.py $python_main_dir$i/PyAPI/AI.py
command="nice -0 python3 $python_main_dir$i/PyAPI/main.py -I $CONNECT_IP -P $PORT -t $k -p $i > $playback_dir/team$k-$code_name.log 2>&1 &"
retry_command "$command" > $playback_dir/client$k.log &
retry_command "$command" > $playback_dir/client$k-$i.log &
elif [ -f "./$code_name" ]; then
echo "find ./$code_name"
command="nice -0 ./$code_name -I $CONNECT_IP -P $PORT -t $k -p $i > $playback_dir/team$k-$code_name.log 2>&1 &"
retry_command "$command" > $playback_dir/client$k.log &
retry_command "$command" > $playback_dir/client$k-$i.log &
else
echo "ERROR. $code_name is not found."
fi
Expand Down

0 comments on commit 1339067

Please sign in to comment.