keep going with recurrent event
This commit is contained in:
@@ -17,14 +17,13 @@ const notifier = {
|
||||
case 'admin_email':
|
||||
return mail.send([config.smtp.auth.user, config.admin_email], 'event', { event, to_confirm: !event.is_visible, config, notification })
|
||||
case 'mastodon':
|
||||
console.error('mando le cose')
|
||||
// instance publish
|
||||
if (bot.bot) {
|
||||
const b = bot.post(event).then(b => {
|
||||
event.activitypub_id = String(b.data.id)
|
||||
return event.save()
|
||||
}).catch(e => {
|
||||
console.error("ERRORE !! ", e)
|
||||
console.error("ERROR !! ", e)
|
||||
})
|
||||
promises.push(b)
|
||||
}
|
||||
@@ -53,9 +52,7 @@ const notifier = {
|
||||
await notifier.sendNotification(notification, event)
|
||||
e.status = 'sent'
|
||||
} catch (err) {
|
||||
// console.error(err)
|
||||
e.status = 'error'
|
||||
// e.error = err
|
||||
}
|
||||
return e.save()
|
||||
})
|
||||
@@ -84,12 +81,4 @@ const notifier = {
|
||||
}
|
||||
}
|
||||
|
||||
// let interval
|
||||
// function startLoop(seconds) {
|
||||
// interval = setInterval(notify, seconds * 1000)
|
||||
// }
|
||||
|
||||
// startLoop(26000)
|
||||
|
||||
module.exports = notifier
|
||||
// export default notifier
|
||||
module.exports = notifier
|
||||
Reference in New Issue
Block a user