mirror of
https://github.com/Websoft9/websoft9.git
synced 2025-02-02 17:08:38 +08:00
fast url
This commit is contained in:
parent
bf2c2cea57
commit
7e3203b6f1
@ -1,3 +1,3 @@
|
|||||||
# Administrator 管理手册
|
# Administrator 管理手册
|
||||||
|
|
||||||
## 环境
|
## 数据同步
|
||||||
|
@ -313,7 +313,6 @@ function fastest_url() {
|
|||||||
|
|
||||||
for url in "${urls[@]}"; do
|
for url in "${urls[@]}"; do
|
||||||
time=$(curl --connect-timeout 3 -s -w '%{time_total}\n' -o /dev/null $url)
|
time=$(curl --connect-timeout 3 -s -w '%{time_total}\n' -o /dev/null $url)
|
||||||
echo $url is $time
|
|
||||||
if (( $(echo "$time < $fastest_time || $fastest_time == 0" | bc -l) )); then
|
if (( $(echo "$time < $fastest_time || $fastest_time == 0" | bc -l) )); then
|
||||||
fastest_time=$time
|
fastest_time=$time
|
||||||
fastest_url=$url
|
fastest_url=$url
|
||||||
@ -347,13 +346,12 @@ ParpareStaticFiles(){
|
|||||||
|
|
||||||
echo "Parpare to install ..."
|
echo "Parpare to install ..."
|
||||||
fasturl=$(fastest_url "${urls[@]}")
|
fasturl=$(fastest_url "${urls[@]}")
|
||||||
sleep 20s
|
echo "fast url is: "$fasturl
|
||||||
echo "curl 5 times, avera fast url is: "$fasturl
|
|
||||||
|
|
||||||
# download apps
|
# download apps
|
||||||
mkdir -p /data/apps
|
mkdir -p /data/apps
|
||||||
clone_repo $fasturl/Websoft9/docker-library /data/library
|
clone_repo $fasturl/Websoft9/docker-library /data/library
|
||||||
clone_repo $fasturl/Websoft9/Stackhub /data/apps/stackhub
|
clone_repo $fasturl/Websoft9/StackHub /data/apps/stackhub
|
||||||
clone_repo $fasturl/Websoft9/stackhub-web /data/stackhubweb
|
clone_repo $fasturl/Websoft9/stackhub-web /data/stackhubweb
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user