Fix for #567 "mailinglist gateway does not recover after database outage".
authorcli
Tue, 27 Apr 2010 22:11:30 +0200
changeset 27d879bab39600
parent 26 407c428adb5b
child 28 15d14b110240
Fix for #567 "mailinglist gateway does not recover after database outage".
org/sonews/mlgw/MailPoller.java
     1.1 --- a/org/sonews/mlgw/MailPoller.java	Tue Apr 27 21:51:12 2010 +0200
     1.2 +++ b/org/sonews/mlgw/MailPoller.java	Tue Apr 27 22:11:30 2010 +0200
     1.3 @@ -63,7 +63,7 @@
     1.4    {
     1.5      Log.get().info("Starting Mailinglist Poller...");
     1.6      int errors = 0;
     1.7 -    while(isRunning() && errors < 5)
     1.8 +    while(isRunning())
     1.9      {
    1.10        try
    1.11        {
    1.12 @@ -127,7 +127,7 @@
    1.13          // AuthentificationFailedException may be thrown if credentials are
    1.14          // bad or if the Mailbox is in use (locked).
    1.15          ex.printStackTrace();
    1.16 -        errors++;
    1.17 +        errors = errors < 5 ? errors + 1 : errors;
    1.18        }
    1.19        catch(InterruptedException ex)
    1.20        {
    1.21 @@ -137,12 +137,12 @@
    1.22        catch(MessagingException ex)
    1.23        {
    1.24          ex.printStackTrace();
    1.25 -        errors++;
    1.26 +        errors = errors < 5 ? errors + 1 : errors;
    1.27        }
    1.28        catch(Exception ex)
    1.29        {
    1.30          ex.printStackTrace();
    1.31 -        errors++;
    1.32 +        errors = errors < 5 ? errors + 1 : errors;
    1.33        }
    1.34      }
    1.35      Log.get().severe("MailPoller exited.");