From: adam Date: Mon, 13 Mar 2006 08:03:43 +0000 (+0000) Subject: fixed bug that could cause Outgoing thread to get stuck X-Git-Url: http://git.megacz.com/?p=org.ibex.mail.git;a=commitdiff_plain;h=a8dfe1ff2aa8f996a21890e71cd9bc87289b59db fixed bug that could cause Outgoing thread to get stuck darcs-hash:20060313080343-5007d-3bd14dd230e83dfe9fd8310359d9f5d9167c61a3.gz --- diff --git a/src/org/ibex/mail/protocol/SMTP.java b/src/org/ibex/mail/protocol/SMTP.java index c3be6a4..1ba2090 100644 --- a/src/org/ibex/mail/protocol/SMTP.java +++ b/src/org/ibex/mail/protocol/SMTP.java @@ -308,7 +308,13 @@ public class SMTP { } } if (!good) break; - if (attempt(it.cur())) it.delete(); + try { + if (attempt(it.cur())) it.delete(); + } catch (Exception e) { + Log.error(SMTP.Outgoing.class, e); + } + Log.info(this, "sleeping for 3s..."); + Thread.sleep(3000); } } catch (Exception e) { //if (e instanceof InterruptedException) throw e; @@ -323,6 +329,7 @@ public class SMTP { while(true) { Log.setThreadAnnotation("[outgoing #"+serial+"] "); wake(); + Thread.sleep(1000); synchronized(Outgoing.class) { Outgoing.class.wait(5 * 60 * 1000); }