- # sleep a bit if updates take less than a minute
- endtime=`date +%s`
- elapsed=$((endtime - starttime))
- if [[ $elapsed -lt 60 ]]
- then
- sleepy=$((60 - $elapsed))
- echo "Sleeping for ${sleepy}s..."
- sleep $sleepy
+ ./nominatim replication --once --threads $INST
+
+<% if node[:nominatim][:enable_git_updates] -%>
+ pushd <%= @srcdir %>
+ if git fetch origin; then
+ # will trigger recompilation if necessary
+ git merge origin/<%= @branch %>
+ else
+ echo "WARNING: git fetch failed."
+ fi
+ popd
+<% end -%>
+
+ if [ -f "<%= @update_maintenance_trigger %>" ]; then
+ rm <%= @update_maintenance_trigger %>
+ ./nominatim refresh --postcodes --word-tokens --threads 4 -v
+<% if node[:nominatim][:enable_qa_tiles] -%>
+ pushd <%= @qabindir %>
+ if python3 cli.py --execute-all; then
+ rm -rf "<%= @qadatadir %>/old"
+ if [ -d "<%= @qadatadir %>/current" ]; then
+ mv "<%= @qadatadir %>/current" "<%= @qadatadir %>/old"
+ fi
+ mv "<%= @qadatadir %>/new" "<%= @qadatadir %>/current"
+ fi
+ popd
+<% end -%>