fix task exception and send mail in dev with no smtp settings
This commit is contained in:
@@ -8,7 +8,7 @@ const locales = require('../../locales')
|
||||
|
||||
const mail = {
|
||||
send (addresses, template, locals, locale = settingsController.settings.instance_locale) {
|
||||
if (!settingsController.settings.admin_email || !settingsController.settings.smtp) {
|
||||
if (process.env.NODE_ENV === 'production' && (!settingsController.settings.admin_email || !settingsController.settings.smtp)) {
|
||||
log.error(`Cannot send any email: SMTP Email configuration not completed!`)
|
||||
return
|
||||
}
|
||||
@@ -47,7 +47,7 @@ const mail = {
|
||||
locale,
|
||||
locales: Object.keys(locales)
|
||||
},
|
||||
transport: settings.smtp
|
||||
transport: settings.smtp || {}
|
||||
})
|
||||
|
||||
const msg = {
|
||||
|
||||
@@ -33,7 +33,6 @@ class Task {
|
||||
}
|
||||
} catch (e) {
|
||||
log.error(`TASK ERROR [${this.name}]: ${e} ${e.stack}`)
|
||||
return Promise.resolve(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -84,7 +83,7 @@ class TaskManager {
|
||||
// remove removable tasks
|
||||
this.tasks = this.tasks.filter(t => t.repeat)
|
||||
|
||||
return Promise.all(tasks)
|
||||
return Promise.allSettled(tasks)
|
||||
}
|
||||
|
||||
async tick () {
|
||||
|
||||
Reference in New Issue
Block a user