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
Feature/21689
Massimiliano Assante 7 years ago
parent 178215ced7
commit 17d7654b02

@ -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"

@ -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();
}
}
@ -191,7 +191,7 @@ public class PeriodicTask implements Runnable {
userRoles.add(DEFAULT_ROLE);
session.setSecurityToken(null);
String token = authorizationService().generateUserToken(new UserInfo(session.getUsername(), userRoles), scope);
_log.debug("received token: "+token);
session.setSecurityToken(token);
_log.debug("PeriodicTask EmailParser: Security token set in session for: "+username + " on " + scope);

Loading…
Cancel
Save