max run time is controlled by tunasync now

This commit is contained in:
z4yx 2020-06-07 21:24:35 +08:00
parent b55d9a8938
commit 6257854349

20
pypi.sh
View File

@ -1,4 +1,5 @@
#!/bin/bash #!/bin/bash
set -e
BANDERSNATCH=${BANDERSNATCH:-"/usr/local/bin/bandersnatch"} BANDERSNATCH=${BANDERSNATCH:-"/usr/local/bin/bandersnatch"}
TUNASYNC_UPSTREAM=${TUNASYNC_UPSTREAM_URL:-"https://pypi.org/"} TUNASYNC_UPSTREAM=${TUNASYNC_UPSTREAM_URL:-"https://pypi.org/"}
CONF="/tmp/bandersnatch.conf" CONF="/tmp/bandersnatch.conf"
@ -34,11 +35,7 @@ packages =
tensorflow-io-nightly tensorflow-io-nightly
tf-nightly-cpu tf-nightly-cpu
EOF EOF
/usr/bin/timeout -s INT 36000 $BANDERSNATCH -c $CONF mirror exec $BANDERSNATCH -c $CONF mirror
if [[ $? == 124 ]]; then
echo 'Sync timeout (/_\\)'
exit 1
fi
else else
cat > $CONF << EOF cat > $CONF << EOF
[mirror] [mirror]
@ -52,17 +49,6 @@ stop-on-error = false
delete-packages = false delete-packages = false
EOF EOF
$BANDERSNATCH -c $CONF mirror exec $BANDERSNATCH -c $CONF mirror
fi fi
TODOFILE="${TUNASYNC_WORKING_DIR}/todo"
if [[ -f $TODOFILE ]]; then
rsize=`stat -c "%s" ${TODOFILE}`
if [[ "$rsize" != "0" ]]; then
echo "Sync Failed T_T"
exit 1
fi
fi
echo "Sync Done ^_-"
exit 0