fix: report only on failures with xo-web 5

This commit is contained in:
Julien Fontanet 2016-06-30 10:12:07 +02:00
parent b2331084d1
commit 6f4509c260

View File

@ -117,6 +117,13 @@ class BackupReportsXoPlugin {
}
const globalSuccess = nSuccess === nCalls
if (globalSuccess && (
reportWhen === 'fail' || // xo-web < 5
reportWhen === 'failure' // xo-web >= 5
)) {
return
}
const start = moment(status.start)
const end = moment(status.end)
const duration = moment.duration(end - start).humanize()
@ -125,10 +132,6 @@ class BackupReportsXoPlugin {
.replace(/([A-Z])/g, ' $1').replace(/^./, letter => letter.toUpperCase()) // humanize
const tag = status.calls[Object.keys(status.calls)[0]].params.tag
if (globalSuccess && reportWhen === 'fail') {
return
}
// Global status.
text.unshift([
`## Global status for "${tag}" (${method}): ${globalSuccess ? 'Success' : 'Fail'}`,