diff --git a/packages/xo-server-backup-reports/src/index.js b/packages/xo-server-backup-reports/src/index.js index db7ad19be..3940e4688 100644 --- a/packages/xo-server-backup-reports/src/index.js +++ b/packages/xo-server-backup-reports/src/index.js @@ -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'}`,