i put like this:
private static ArangoDB arangoDB = new
ArangoDB.Builder().timeout(1000)........ // 1 second?
i tested turning off the Wifi, and when i click in the button that do this:
try {
BaseDocument myDocument =
Conexao.getCon(loginlogout).db("patricia").collection("usuarios").getDocument("10419",
BaseDocument.class);
System.out.println("Key: " + myDocument.getKey());
lbTeste.setText(myDocument.getKey());
} catch (ArangoDBException e) {
System.err.println("Failed to get document: myKey; " +
e.getMessage());
if (e.getMessage().equals("Was not able to connect to any
host")) {
Conexao.inicializaConexao();
}
}
the UI frozen and stay frozen for long time, and only come back if i turn
on Wifi, i need that the request stop trying after this 1 second timeout,
but look like that is not ocurring
Em segunda-feira, 16 de abril de 2018 10:02:40 UTC-3, mpv1989 escreveu:
>
> You can configure a timeout when creating your driver instance.
>
> int timeout = 60 * 1000; //milliseconds
> ArangoDB arango = new ArangoDB.Builder().timeout(timeout).build();
>
>
>
> On Monday, 16 April 2018 14:56:54 UTC+2, Jefferson wrote:
>>
>> When the network is down, the subsequent request frozen, i need a way to
>> limit the maximum seconds to get time out of request getting in a specific
>> Exception, how to do this? Thank you.
>>
>
--
You received this message because you are subscribed to the Google Groups
"ArangoDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.