Merge pull request #12 from whiteout-io/dev/imap-error

[WO-221] do silent imap reconnect without invoking callback to login vie...
This commit is contained in:
Felix Hammerl 2014-01-28 06:11:54 -08:00
commit f7dde61876
1 changed files with 10 additions and 2 deletions

View File

@ -116,9 +116,17 @@ define(function(require) {
smtpClient = new SmtpClient(smtpOptions);
imapClient.onError = function(err) {
console.log('IMAP error... reconnecting.', err);
console.log('IMAP error.', err);
console.log('IMAP reconnecting...');
// re-init client modules on error
self.onConnect(callback);
self.onConnect(function(err) {
if (err) {
console.error('IMAP reconnect failed!', err);
return;
}
console.log('IMAP reconnect successful.');
});
};
// connect to clients