Resilient to Email server failures

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portal/social-mail-servlet@144139 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2017-02-22 16:04:00 +00:00
parent 178215ced7
commit 17d7654b02
2 changed files with 7 additions and 5 deletions

View File

@ -2,10 +2,12 @@
<Changeset component="org.gcube.portal.social-mail-servlet.2-1-1"
date="2017-02-03">
<Change>Minor refactor for comment replies</Change>
<Change>Resilient to Email server failures</Change>
</Changeset>
<Changeset component="org.gcube.portal.social-mail-servlet.2-1-0"
date="2016-08-31">
<Change>Added possibility to change poller time at runtime as well as to quit it by editing a property file in the server</Change>
<Change>Added possibility to change poller time at runtime as well as
to quit it by editing a property file in the server</Change>
<Change>Added support for Auth2</Change>
</Changeset>
<Changeset component="org.gcube.portal.social-mail-servlet.1-4-0"

View File

@ -96,9 +96,9 @@ public class PeriodicTask implements Runnable {
public void run() {
boolean keepPolling = true;
while (keepPolling) {
_log.debug("PeriodicTask starting for portal/site having name: " + popAccount.getPortalName());
check(popAccount.getPortalName(), popAccount.getPop3Server(), popAccount.getPop3user(), popAccount.getPop3password());
try {
_log.debug("PeriodicTask starting for portal/site having name: " + popAccount.getPortalName());
check(popAccount.getPortalName(), popAccount.getPop3Server(), popAccount.getPop3user(), popAccount.getPop3password());
int pollingInterval = getPollingInterval();
if (pollingInterval > 0) {
_log.debug("EmailParser restarts in " + pollingInterval + " minutes, to change this polling delay edit gcube-data.properties file under $CATALINA_HOME/conf");
@ -108,7 +108,7 @@ public class PeriodicTask implements Runnable {
_log.info("EmailParser stopped for " + popAccount.getPortalName() + ", found value less than 1 in gcube-data.properties file under $CATALINA_HOME/conf");
keepPolling = false;
}
} catch (InterruptedException e) {
} catch (Exception e) {
e.printStackTrace();
}
}