2
0
Fork 0

osm-garmin: improve performance

main
Ducky 2023-09-26 04:13:53 +01:00
parent 876295aac2
commit e96e34f6ff
2 changed files with 18 additions and 7 deletions

View File

@ -87,7 +87,7 @@ function update_bounds() {
} }
download_bounds "bounds" download_bounds "bounds"
download_bounds "sea" #download_bounds "sea"
} }
function update_osm_map() { function update_osm_map() {
@ -121,8 +121,6 @@ regions_array="$(echo $regions | tr ";" "\n")"
for region in $regions_array; do for region in $regions_array; do
if [[ "$(check_osm_region_exists "$region")" == "true" ]]; then if [[ "$(check_osm_region_exists "$region")" == "true" ]]; then
echo "👀 Checking OSM updates: $region"
if [[ "$(check_osm_update "$region")" == "true" ]]; then if [[ "$(check_osm_update "$region")" == "true" ]]; then
echo "🌍 Updating OSM map: $region" echo "🌍 Updating OSM map: $region"
update_osm_map "$region" update_osm_map "$region"
@ -135,13 +133,16 @@ for region in $regions_array; do
fi fi
done done
# TODO: Don't update this if there wasn't any updates
echo "📒 Updating bounds..." echo "📒 Updating bounds..."
update_bounds update_bounds
for region in $regions_array; do for region in $regions_array; do
if [[ "$(check_osm_region_exists "$region")" == "true" ]]; then if [[ "$(check_osm_region_exists "$region")" == "true" ]]; then
echo "🔨 Building Garmin map: $region" if [[ "$(check_osm_update "$region")" == "true" ]]; then
build_gmap "$region" "$style" echo "🔨 Building Garmin map: $region"
build_gmap "$region" "$style"
fi
else else
echo "⚠️ Region \"$region\" does not exist" echo "⚠️ Region \"$region\" does not exist"
fi fi

View File

@ -3,6 +3,13 @@
. /app/utils.sh . /app/utils.sh
sleep_time=3600 sleep_time=3600
sleep_time_fail=60
function wait() {
delay="$1"
echo "💤 Sleeping $delay seconds..."
sleep $delay
}
while : while :
do do
@ -14,6 +21,9 @@ do
/app/build-gmap.sh "$regions" "$style" /app/build-gmap.sh "$regions" "$style"
echo "💤 Sleeping $sleep_time seconds..." if [[ $? == 0 ]]; then
sleep $sleep_time wait $sleep_time
else
wait $sleep_time_fail
fi
done done