mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-03 03:19:24 +01:00
Reduced timeout on fallback
This saves 4 x 10 seconds keeping the device awake
This commit is contained in:
@@ -414,12 +414,18 @@ public class EmailService implements AutoCloseable {
|
||||
ip6 = true;
|
||||
}
|
||||
|
||||
String prop = "mail." + protocol + ".connectiontimeout";
|
||||
String timeout = properties.getProperty(prop);
|
||||
try {
|
||||
Log.i("Falling back to " + iaddr.getHostAddress());
|
||||
properties.put(prop, Integer.toString(DEFAULT_CONNECT_TIMEOUT / 2));
|
||||
_connect(iaddr.getHostAddress(), port, user, password, factory);
|
||||
return;
|
||||
} catch (MessagingException ex1) {
|
||||
Log.w(ex1);
|
||||
} finally {
|
||||
if (timeout != null)
|
||||
properties.put(prop, timeout);
|
||||
}
|
||||
}
|
||||
} catch (Throwable ex1) {
|
||||
|
||||
Reference in New Issue
Block a user