Set Timeout for calculating directions

Hi.
I have a problem that when determining the route, e.g. between Europe and the UK without a ferry and toll roads, ORS tries to determine the route, unfortunately it takes too long. Is it possible to set a timeout for the calculated route and return any message? In my solution, it takes 30 seconds before waiting for a response is interrupted. ORS tries to find a route and it takes up to 5 minutes to stop calculating anything.
Thanks for the hint.
Best,
Jarek

Hey,

are you talking about the public API offered at api.openrouteservice.org? If so, the limits set there should ensue that route requests don’t take too long - i.e. a request from Europe and the UK without ferries takes some time, but less than 30 seconds.

If you are using the public API, there is no option to stop the request - you’ll have to implement any timeout logic client-wise.

If you’re using your own ors instance, your system and setup will determine the time that your queries need. I’d still recommend implementing any timeout logic client-side.

Best regards

Hi,
Thanks for response.
Yes I use own instance, in normal work it works smoothly and quickly, the only problem is that it cannot determine the route. Then there is a long waiting period for an answer. Even if I set the timeout on my side, java consumes a lot of CPU. Which causes it to have trouble handling other queries.
Best regards