From dd11cc0f989cddeaf0a0438eba99263d59e2f980 Mon Sep 17 00:00:00 2001 From: Ducky Date: Tue, 26 Sep 2023 03:41:53 +0100 Subject: [PATCH] osm-garmin: remove sleeps --- osm-garmin/app/daemon.sh | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/osm-garmin/app/daemon.sh b/osm-garmin/app/daemon.sh index 086d8ab..07b2184 100644 --- a/osm-garmin/app/daemon.sh +++ b/osm-garmin/app/daemon.sh @@ -2,23 +2,6 @@ . /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 : do regions="europe/great-britain" @@ -32,14 +15,10 @@ do for region in $regions_array; do if [[ "$(check_osm_update "$region")" == "true" ]]; then /app/build-gmap.sh "$region" "$style" - - if [[ $? == 0 ]]; then - wait $sleep_build_success "build success" - else - wait $sleep_build_fail "build fail" - fi - else - wait $sleep_no_update "no update" + # TODO: Tear this apart so we can update the maps and bounds separately, + # then build all the maps afterwards (less wasteful!) fi done + + sleep 3600 done \ No newline at end of file