fix: report only on failures with xo-web 5
This commit is contained in:
parent
b2331084d1
commit
6f4509c260
@ -117,6 +117,13 @@ class BackupReportsXoPlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const globalSuccess = nSuccess === nCalls
|
const globalSuccess = nSuccess === nCalls
|
||||||
|
if (globalSuccess && (
|
||||||
|
reportWhen === 'fail' || // xo-web < 5
|
||||||
|
reportWhen === 'failure' // xo-web >= 5
|
||||||
|
)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const start = moment(status.start)
|
const start = moment(status.start)
|
||||||
const end = moment(status.end)
|
const end = moment(status.end)
|
||||||
const duration = moment.duration(end - start).humanize()
|
const duration = moment.duration(end - start).humanize()
|
||||||
@ -125,10 +132,6 @@ class BackupReportsXoPlugin {
|
|||||||
.replace(/([A-Z])/g, ' $1').replace(/^./, letter => letter.toUpperCase()) // humanize
|
.replace(/([A-Z])/g, ' $1').replace(/^./, letter => letter.toUpperCase()) // humanize
|
||||||
const tag = status.calls[Object.keys(status.calls)[0]].params.tag
|
const tag = status.calls[Object.keys(status.calls)[0]].params.tag
|
||||||
|
|
||||||
if (globalSuccess && reportWhen === 'fail') {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// Global status.
|
// Global status.
|
||||||
text.unshift([
|
text.unshift([
|
||||||
`## Global status for "${tag}" (${method}): ${globalSuccess ? 'Success' : 'Fail'}`,
|
`## Global status for "${tag}" (${method}): ${globalSuccess ? 'Success' : 'Fail'}`,
|
||||||
|
Loading…
Reference in New Issue
Block a user