mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-27 07:58:49 +01:00
improve testing of proxy delete by saving up a number of relayIDs and
sending with multiple -d flags to rq.
This commit is contained in:
parent
dc273c7162
commit
c2c673e932
1 changed files with 14 additions and 1 deletions
|
@ -225,11 +225,17 @@ close_device() {
|
|||
unset ROOMS[$ID]
|
||||
}
|
||||
|
||||
OBITS=""
|
||||
|
||||
kill_from_log() {
|
||||
LOG=$1
|
||||
RELAYID=$(./scripts/relayID.sh --long $LOG)
|
||||
if [ -n "$RELAYID" ]; then
|
||||
../relay/rq -a $HOST -d $RELAYID 2>/dev/null || true
|
||||
OBITS="$OBITS -d $RELAYID"
|
||||
if [ 0 -eq $(($RANDOM%2)) ]; then
|
||||
../relay/rq -a $HOST $OBITS 2>/dev/null || true
|
||||
OBITS=""
|
||||
fi
|
||||
return 0 # success
|
||||
fi
|
||||
echo "unable to send kill command for $LOG"
|
||||
|
@ -281,10 +287,15 @@ check_game() {
|
|||
close_device $ID $DONEDIR "game over"
|
||||
done
|
||||
date
|
||||
# XWRELAY_ERROR_DELETED may be old
|
||||
elif grep -q 'relay_error_curses(XWRELAY_ERROR_DELETED)' $LOG; then
|
||||
echo "deleting $LOG $(connName $LOG) b/c another resigned"
|
||||
kill_from_log $LOG || true
|
||||
close_device $KEY $DEADDIR "other resigned"
|
||||
elif grep -q 'relay_error_curses(XWRELAY_ERROR_DEADGAME)' $LOG; then
|
||||
echo "deleting $LOG $(connName $LOG) b/c another resigned"
|
||||
kill_from_log $LOG || true
|
||||
close_device $KEY $DEADDIR "other resigned"
|
||||
else
|
||||
maybe_resign $KEY
|
||||
fi
|
||||
|
@ -334,6 +345,8 @@ run_cmds() {
|
|||
fi
|
||||
done
|
||||
|
||||
[ -n "$OBITS" ] && ../relay/rq -a $HOST $OBITS 2>/dev/null || true
|
||||
|
||||
# kill any remaining games
|
||||
if [ $COUNT -gt 0 ]; then
|
||||
mkdir -p ${LOGDIR}/not_done
|
||||
|
|
Loading…
Add table
Reference in a new issue