komoot / photon

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

Add status API #763

Closed ybert closed 4 months ago

ybert commented 7 months ago

This is a draft about the status API feature. Resolves #711 I'm not sure about the Nominatim part of the code for import date, so if you have any idea of improvements feel free to ask.

ybert commented 7 months ago

@lonvia Could you review it when you have time ?

lonvia commented 4 months ago

Apologies, my PRs are now causing conflicts.

With updates working again, the status handler will need to query the database for the current import date now instead of just returning the static date read on startup. The date also needs to be updated in the database after updates are finished.

Would you be interested to adapt the code here? It would be a nice addition to the next release.

ybert commented 4 months ago

@lonvia I made some changes to adapt the code. What do you think ?

lonvia commented 4 months ago

Looks good to me. Just one more tiny thing: there is another route to updating at https://github.com/komoot/photon/blob/ee3ceaa55fe19ba5e8450728d62a6fc724986409/src/main/java/de/komoot/photon/App.java#L189

This also needs to use the new update function, so that the date is set.

Once you remove the 'draft' status, I'm happy to merge this.