-
Notifications
You must be signed in to change notification settings - Fork 9.9k
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
server: added loading page while model loading #9401
Conversation
Resolves #9158 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We cannot return HTML for JSON API endpoint (please don't change the test file)
This was not the intent of the request. The intent was when an html file was requested, and the model was loading, that the server not substitute a JSON error result. I'm sorry that I don't have experience with pull requests and couldn't submit this myself. There is a discussion of what I was trying to accomplish here: |
Sorry about that. There was a bit of confusion but it should be resolved now. @BradHutchings, now when you visit the page it displays the loading message without interfering with api calls that return JSON. @ngxson, I ran the CI checks in my forked repo and they all pass. |
server_state current_state = state.load(); | ||
if (current_state == SERVER_STATE_LOADING_MODEL) { | ||
res_error(res, format_error_response("Loading model", ERROR_TYPE_UNAVAILABLE)); | ||
if(req.path == "/"){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're missing one requirement from the original issue #9158
Here only /
is catched, not *.html
. I leave a suggestion on my comment #9401 (comment) , but I'll apply it myself.
I can't push to your repo, so I created a PR to replace this. |
Fix #9158