chore(bulk-mailer): Stop all processing on error.
bulk-mailer will exit with a non-0 status code if there is an error. The bash scripts check exit codes and abort on non-0
This commit is contained in:
Родитель
f02e29237a
Коммит
de8e355de0
|
@ -79,7 +79,6 @@ P.resolve()
|
|||
})
|
||||
})
|
||||
.then(null, function (error) {
|
||||
console.error('error', error)
|
||||
log.error({
|
||||
op: 'send.abort',
|
||||
err: error
|
||||
|
@ -89,8 +88,7 @@ P.resolve()
|
|||
.then(writeErrors)
|
||||
.then(writeUnsent)
|
||||
.then(function () {
|
||||
console.log('bye bye!')
|
||||
process.exit(runningError ? 1 : 0)
|
||||
process.exit(runningError || errorCount ? 1 : 0)
|
||||
})
|
||||
|
||||
var fakeEmailCount = 0
|
||||
|
|
|
@ -10,4 +10,5 @@ DIRNAME=${1}
|
|||
for BATCH in $(find ${DIRNAME} -name "*.json" -type f); do
|
||||
echo ${BATCH} $PWD
|
||||
./reset-send-batch.sh ${BATCH}
|
||||
rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi
|
||||
done
|
||||
|
|
|
@ -28,11 +28,13 @@ fi
|
|||
echo ${BATCH}
|
||||
|
||||
node must-reset.js -i ${BATCH}
|
||||
rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi
|
||||
|
||||
### TODO If we need more delay in between the batches the bulk-mailer itself sends, add a `-d <seconds> to the below line.
|
||||
### If instead of sending 10 emails at a time, the mailer should send 5 (or some other number), -b <batch_size>
|
||||
### TODO Finally, when sending for real for real, the --send option needs to be added.
|
||||
node bulk-mailer.js -i ${BATCH} -t password_reset_required -e ${ERRORS_OUTPUT} -u ${UNSENT_OUTPUT} --real
|
||||
rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi
|
||||
|
||||
|
||||
# once the batch is completed, remove the batch file to
|
||||
|
|
Загрузка…
Ссылка в новой задаче