
Merge branch 'fix/endless-email' into 'next'
from pull-request 1562 * refs/heads/fix/endless-email: mail: Fix the error message while sending a email mail: Fix delivery failure under certain condition mail: Fix endless notification email Reviewed-by: 백기선
@2dff37eeaf374a0940503c0f2753f7c64916b533
--- app/models/NotificationMail.java
+++ app/models/NotificationMail.java
... | ... | @@ -114,7 +114,7 @@ |
114 | 114 |
try { |
115 | 115 |
sendMail(); |
116 | 116 |
} catch (Exception e) { |
117 |
- play.Logger.warn("Failed to send notification mail", e); |
|
117 |
+ play.Logger.warn("Error occured while sending notification mails", e); |
|
118 | 118 |
} |
119 | 119 |
} |
120 | 120 |
|
... | ... | @@ -139,10 +139,15 @@ |
139 | 139 |
.orderBy("notificationEvent.created ASC").findList(); |
140 | 140 |
|
141 | 141 |
for (NotificationMail mail: mails) { |
142 |
- if (mail.notificationEvent.resourceExists()) { |
|
143 |
- sendNotification(mail.notificationEvent); |
|
142 |
+ try { |
|
143 |
+ NotificationEvent event = mail.notificationEvent; |
|
144 |
+ mail.delete(); |
|
145 |
+ if (event.resourceExists()) { |
|
146 |
+ sendNotification(event); |
|
147 |
+ } |
|
148 |
+ } catch (Exception e) { |
|
149 |
+ play.Logger.warn("Error occured while sending a notification mail", e); |
|
144 | 150 |
} |
145 |
- mail.delete(); |
|
146 | 151 |
} |
147 | 152 |
} |
148 | 153 |
}, |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?