Skip to content

Commit

Permalink
temporarily increase query timeout to avoid failing planet import dur…
Browse files Browse the repository at this point in the history
…ing database warmup
  • Loading branch information
iAlex97 authored and philipkozeny committed Oct 7, 2023
1 parent b4ec7dd commit c06e9bb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions 4.3/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,18 @@ else
fi
fi

export NOMINATIM_QUERY_TIMEOUT=600
export NOMINATIM_REQUEST_TIMEOUT=3600
if [ "$REVERSE_ONLY" = "true" ]; then
# --search-only is a workaround until https://github.com/osm-search/Nominatim/issues/3213
# is merged and a new Nominatim version (probably 4.3.1) is released.
# Afterwards, we should revert back to using --reverse instead
sudo -H -E -u nominatim nominatim admin --warm --search-only
else
sudo -H -E -u nominatim nominatim admin --warm
fi
export NOMINATIM_QUERY_TIMEOUT=10
export NOMINATIM_REQUEST_TIMEOUT=60

# gather statistics for query planner to potentially improve query performance
# see, https://github.com/osm-search/Nominatim/issues/1023
Expand Down
4 changes: 4 additions & 0 deletions 4.3/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ fi
tail -Fv /var/log/postgresql/postgresql-14-main.log /var/log/apache2/access.log /var/log/apache2/error.log /var/log/replication.log &
tailpid=${!}

export NOMINATIM_QUERY_TIMEOUT=600
export NOMINATIM_REQUEST_TIMEOUT=3600
if [ "$REVERSE_ONLY" = "true" ]; then
echo "Warm database caches for reverse queries"
# --search-only is a workaround until https://github.com/osm-search/Nominatim/issues/3213
Expand All @@ -69,6 +71,8 @@ else
echo "Warm database caches for search and reverse queries"
sudo -H -E -u nominatim nominatim admin --warm > /dev/null
fi
export NOMINATIM_QUERY_TIMEOUT=10
export NOMINATIM_REQUEST_TIMEOUT=60
echo "Warming finished"

echo "--> Nominatim is ready to accept requests"
Expand Down

0 comments on commit c06e9bb

Please sign in to comment.