[PC-BSD Commits] r13504 - pcbsd/current/src-sh/pc-updatemanager
svn at pcbsd.org
svn at pcbsd.org
Tue Oct 25 08:09:05 PDT 2011
Author: kris
Date: 2011-10-25 08:09:05 -0700 (Tue, 25 Oct 2011)
New Revision: 13504
Modified:
pcbsd/current/src-sh/pc-updatemanager/pc-updatemanager
Log:
Improve the update manager to make it more fault-resistant, give more allowances for transfer errors / timeouts, etc.
Modified: pcbsd/current/src-sh/pc-updatemanager/pc-updatemanager
===================================================================
--- pcbsd/current/src-sh/pc-updatemanager/pc-updatemanager 2011-10-25 12:51:48 UTC (rev 13503)
+++ pcbsd/current/src-sh/pc-updatemanager/pc-updatemanager 2011-10-25 15:09:05 UTC (rev 13504)
@@ -303,7 +303,11 @@
local numAtt=0
# Wait a moment between downloads, seems to fix protocol errors
- sleep 1
+ if [ $dSleepT -ge 4 ] ; then
+ sleep 2
+ dSleepT=0
+ fi
+ dSleepT=`expr ${dSleepT} + 1`
while
z=1
@@ -369,11 +373,13 @@
if [ $numAtt -gt 3 ] ; then
exit_err "Error: Failed to download ${FETCHFILE}"
else
- sleep 1
+ # Sleep before retrying a failed download
+ sleep 30
continue
fi
fi
+
if [ "${EXIT}" = "0" ]; then
return 0
else
@@ -887,6 +893,8 @@
check) do_check ;;
install) # First update our available list with latest from server
${0} check >/dev/null 2>/dev/null ;
+ # Init the download sleep timer
+ dSleepT=0
do_install "${2}" ;;
*) show_usage ;;
esac
More information about the Commits
mailing list