-
Notifications
You must be signed in to change notification settings - Fork 762
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Last indexed time in API? #3423
Comments
Indeed, there is no API call to get the last indexed time. There is no problem adding it however there are multiple facets to this: the time of the last reindex is normally "stored" as last modified time in the |
is the modified time at |
It is not, see the opengrok/opengrok-indexer/src/main/java/org/opengrok/indexer/index/IndexDatabase.java Lines 541 to 546 in e833233
|
As a workaround, touch a file under source root that was already indexed whenever running indexer. This should help, at least until #3077 is implemented. |
So, if I understand the use case correctly, you would like to have a way to tell when the last indexer run has finished, correct ? Should have really asked that question before starting the work on the indextime API endpoint. |
So far I had already done what you suggested which is to touch a file at the start of every indexing session. The use case I'm trying to solve is for deploying to kubernetes, specifically I have written a liveness and readiness check which is a command that can be run in the container periodically, and if that command returns exit code 0 all is well, otherwise the service is considered unavailable/unhealthy (depending on the check). I modified the index.sh script to include a This allowed me to use For liveness checks I wrote an
The 1 day figure is because one of our projects is huge and it actually takes a whole day to index. The reason all this is necessary is because we have found indexing has stopped in the past and we were unsure why. With kubernetes the idea is to restart the container automatically based on the indications given. Hope this helps provides some context. I should say I actually prefer the 'command in container' approach rather than using the http API as the API has issues around authenticating which present a challenge for my particular deployment. |
You need to touch a file in one of the projects under the source root. The indexer will then pick it up and update the related document in the index, making it dirty. This will lead to the index time stamp file to be touched. |
As for the API vs. authentication, you can use Bearer token, see https://github.com/oracle/opengrok/wiki/Web-services#authenticationauthorization |
Last indexed time is displayed on the bottom of the page and indicates to an extent if the indexing process is working as expected.
Is this available via the API / as JSON? I looked at the API docs and couldn't find anything.
The text was updated successfully, but these errors were encountered: