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

View File

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