osm-garmin: remove sleeps
parent
64d956171d
commit
dd11cc0f98
|
@ -2,23 +2,6 @@
|
||||||
|
|
||||||
. /app/utils.sh
|
. /app/utils.sh
|
||||||
|
|
||||||
sleep_build_fail="10" # 10 seconds
|
|
||||||
sleep_build_success="43200" # 12 hours
|
|
||||||
sleep_no_update="3600" # 1 hour
|
|
||||||
sleep_no_region="10" # 10 seconds
|
|
||||||
|
|
||||||
function wait() {
|
|
||||||
time="$1"
|
|
||||||
action="$2"
|
|
||||||
|
|
||||||
message="💤 Sleeping $time seconds"
|
|
||||||
[[ -n "$action" ]] && message="$message ($action)"
|
|
||||||
message="$message..."
|
|
||||||
|
|
||||||
echo "$message"
|
|
||||||
sleep $time
|
|
||||||
}
|
|
||||||
|
|
||||||
while :
|
while :
|
||||||
do
|
do
|
||||||
regions="europe/great-britain"
|
regions="europe/great-britain"
|
||||||
|
@ -32,14 +15,10 @@ do
|
||||||
for region in $regions_array; do
|
for region in $regions_array; do
|
||||||
if [[ "$(check_osm_update "$region")" == "true" ]]; then
|
if [[ "$(check_osm_update "$region")" == "true" ]]; then
|
||||||
/app/build-gmap.sh "$region" "$style"
|
/app/build-gmap.sh "$region" "$style"
|
||||||
|
# TODO: Tear this apart so we can update the maps and bounds separately,
|
||||||
if [[ $? == 0 ]]; then
|
# then build all the maps afterwards (less wasteful!)
|
||||||
wait $sleep_build_success "build success"
|
|
||||||
else
|
|
||||||
wait $sleep_build_fail "build fail"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
wait $sleep_no_update "no update"
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
sleep 3600
|
||||||
done
|
done
|
Loading…
Reference in New Issue