oengusio / oengus-webapp

Frontend for oengus
https://oengus.io
GNU Affero General Public License v3.0
5 stars 4 forks source link

Show error page if the backend is down #51

Open duncte123 opened 2 years ago

duncte123 commented 2 years ago

Currently, v2 takes ages to load if the backend can't be reached. There should be a quick fail showing an error page saying that Oengus will be back soon.

BobChao87 commented 2 years ago

Some of the API responses can be a little slow however, so what kind of time frame are we thinking? 10 seconds? 15 seconds?

duncte123 commented 2 years ago

I would say 30 seconds, but it also needs to take into account the 502 response code and not cache that

BobChao87 commented 2 years ago

30, can do. I was thinking maybe a fused timer that pits the API response and just a 30s sleep call against each other to handle that. As for error responses, they should probably be given as the reason for the error instead of the timeout. This shouldn't be too bad to make. And, conveniently, I just taught my local API simulator how to throw errors.

duncte123 commented 2 years ago

The 502 does not come from the API, it comes from caddy (the HTTP proxy).

BobChao87 commented 2 years ago

Does the system bypass caddy when querying the API from inside of Docker?