keep going with recurrent event

This commit is contained in:
lesion
2019-07-13 01:02:11 +02:00
parent c929c314a9
commit 03b563971b
15 changed files with 109 additions and 72 deletions

View File

@@ -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