3def22932a178f8211e6fef5e28cf123173e27e1 chmalee Fri Mar 2 09:14:59 2018 -0800 Adding a comment on why we need to check if we can connect to genome-euro diff --git src/browserbox/root/updateBrowser.sh src/browserbox/root/updateBrowser.sh index 4a53848..53beca9 100755 --- src/browserbox/root/updateBrowser.sh +++ src/browserbox/root/updateBrowser.sh @@ -465,30 +465,31 @@ #LATENCY=`ping genome.ucsc.edu -n -c1 -q | grep rtt | cut -d' ' -f4 | cut -d/ -f2 | cut -d. -f1` #if [ "$LATENCY" -gt "90" ]; then #echo making low-latency changes /usr/local/apache/cgi-bin/hgMirror postRsyncUpdates # the local-only hg.conf settings file has to exist as it is included from hg.conf # In case it got deleted due to some error, recreate it if [ ! -f /usr/local/apache/cgi-bin/hg.conf.local ] ; then echo Creating /usr/local/apache/cgi-bin/hg.conf.local echo allowHgMirror=true > /usr/local/apache/cgi-bin/hg.conf.local fi # Sept 2017: check if genome-euro mysql server is closer if [ ! -f /usr/local/apache/trash/registration.txt ]; then + # Mar 2018: check if we can connect to genome-euro before checking what is closest curl -sSI genome-euro.ucsc.edu 2>&1 > /dev/null if [[ $? -eq 0 ]]; then echo comparing latency: genome.ucsc.edu Vs. genome-euro.ucsc.edu euroSpeed=$( (time -p (for i in `seq 10`; do curl -sSI genome-euro.ucsc.edu > /dev/null; done )) 2>&1 | grep real | cut -d' ' -f2 ) ucscSpeed=$( (time -p (for i in `seq 10`; do curl -sSI genome.ucsc.edu > /dev/null; done )) 2>&1 | grep real | cut -d' ' -f2 ) if [[ $(awk '{if ($1 <= $2) print 1;}' <<< "$euroSpeed $ucscSpeed") -eq 1 ]]; then echo genome-euro seems to be closer echo modifying gbib to pull data from genome-euro instead of genome sed -i s/slow-db.host=genome-mysql.cse.ucsc.edu/slow-db.host=genome-euro-mysql.soe.ucsc.edu/ /usr/local/apache/cgi-bin/hg.conf else echo genome.ucsc.edu seems to be closer echo not modifying /usr/local/apache/cgi-bin/hg.conf fi fi fi