Skip to content
This repository has been archived by the owner on Sep 12, 2018. It is now read-only.

Commit

Permalink
mail: Fix endless notification email
Browse files Browse the repository at this point in the history
Yobi was sending a notification email endlessly if it failed to delete
the email from the sending queue. It may happen if the database is
corrupted.

Do not send the notification email if an exception was thrown when
deleting it from the queue(notification_email table).
  • Loading branch information
Yi EungJun committed Apr 1, 2015
1 parent 7b24f91 commit 2799c86
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/models/NotificationMail.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,11 @@ private void sendMail() {
.orderBy("notificationEvent.created ASC").findList();

for (NotificationMail mail: mails) {
if (mail.notificationEvent.resourceExists()) {
sendNotification(mail.notificationEvent);
}
NotificationEvent event = mail.notificationEvent;
mail.delete();
if (event.resourceExists()) {
sendNotification(event);
}
}
}
},
Expand Down

0 comments on commit 2799c86

Please sign in to comment.