Compare commits

..

2 Commits

Author SHA1 Message Date
Julien Fontanet
be503f1341 0.4.1 2016-06-30 10:12:30 +02:00
Julien Fontanet
6f4509c260 fix: report only on failures with xo-web 5 2016-06-30 10:12:07 +02:00
2 changed files with 8 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "xo-server-backup-reports",
"version": "0.4.0",
"version": "0.4.1",
"license": "AGPL-3.0",
"description": "Backup reports plugin for XO-Server",
"keywords": [

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'}`,