Run jobs only once at a time. Start an task api.

This commit is contained in:
baldo 2016-06-03 23:42:17 +02:00
commit 638cc94db3
9 changed files with 99 additions and 7 deletions

View file

@ -2,11 +2,13 @@
angular.module('ffffng').factory('MailQueueJob', function (MailService, Logger) {
return {
run: function () {
run: function (callback) {
MailService.sendPendingMails(function (err) {
if (err) {
Logger.tag('mail', 'queue').error('Error sending pending mails:', err);
}
callback();
});
}
};