U
U
UnoLagrima2019-09-12 16:00:29
High availability
UnoLagrima, 2019-09-12 16:00:29

How to get a permanent request?

Suppose there is a qiwi application that we all use.
Next, we go through authorization, if everything is OK and the server is available, the application gives us access.
If the application is not available, it gives an error "not available" after authorization.
How can I for example constantly find out every 3-5 minutes whether the application is available or not?
What should I know: ip address or what?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikita Kit, 2019-09-12
@ShadowOfCasper

Well put it out

setInterval( () => {
   fetch('ip/request-url').then((resp) => { /*прила доступна*/}).catch(error =>{/*прила недоступна*/});
} ,5000)

Or open a web socket if the server is yours and you can add the functionality of sending data to the front about the availability of the service. But more code is needed here. Ajaxing by interval is easier, but will not tell you sec for sec when the app is available

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question