komoot / photon

an open source geocoder for openstreetmap data
Apache License 2.0
1.83k stars 278 forks source link

Add a status call for the update API #780

Closed lonvia closed 4 months ago

lonvia commented 4 months ago

This adds a new API endpoint /nominatim-update/status. It returns "OK" if the /nominatim-update endpoint is usable and "BUSY" if an update is ongoing. It can be used to poll the server during an update cycle.

Using this endpoint, the continuous update script can be switched back to triggering updates via the API.

Also adds a check that the necessary data tables for updates are there when starting up the server. If they are missing, the update endpoints are disabled and you get a 404.