Server check guard change 7 x #4100
Draft
+458
−224
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
References
Fixes #4074
Description
After getting rid of the of /server/api request for #3961, one more /server/api check was found in the ServerCheckGuard that will be performed with every load to check if the server is not down.
This can still affect performance when a slower REST API is used.
This PR removes the initial call on load to check if the backend is up. Instead it will only perform this call if a request fails with a 500 or a 0 (Unknown) status. If the server request then fails, a redirect is done to the 500 page.
The additional check and redirect are performed in the request effects but will not hold up the rest of the object handling.
Instructions for Reviewers
To test this feature, set up a local backend and frontend where you can turn the backend on and off.
Checklist
main
branch of code (unless it is a backport or is fixing an issue specific to an older branch).npm run lint
npm run check-circ-deps
)package.json
), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.