Reduced close timeout

This commit is contained in:
M66B 2018-11-08 11:08:53 +00:00
parent 079adcb246
commit f2dc80223f
3 changed files with 6 additions and 3 deletions

View File

@ -508,7 +508,7 @@ public class FragmentSetup extends FragmentEx {
private Intent getIntentHelp() {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("https://github.com/M66B/open-source-email/blob/master/SETUP.md"));
intent.setData(Uri.parse("https://github.com/M66B/open-source-email/blob/master/SETUP.md#setup-help"));
return intent;
}

View File

@ -64,6 +64,7 @@ public class MessageHelper {
private String raw = null;
final static int NETWORK_TIMEOUT = 60 * 1000; // milliseconds
final static int CLOSE_TIMEOUT = 20 * 1000; // milliseconds
static Properties getSessionProperties(int auth_type, boolean insecure) {
Properties props = new Properties();

View File

@ -1172,9 +1172,11 @@ public class ServiceSynchronize extends LifecycleService {
});
t.start();
try {
t.join(MessageHelper.NETWORK_TIMEOUT);
if (t.isAlive())
t.join(MessageHelper.CLOSE_TIMEOUT);
if (t.isAlive()) {
Log.w(Helper.TAG, account.name + " Close timeout");
t.interrupt();
}
} catch (InterruptedException ex) {
Log.w(Helper.TAG, account.name + " close wait " + ex.toString());
t.interrupt();