Skip to content

Commit

Permalink
changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
MathieuRA committed Sep 9, 2024
1 parent 9437476 commit 4a00286
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
- [V2V] Fix computation of `memory_static_max`
- **XO 6**:
- [Dashboard] Display backup issues data (PR [#7974](https://github.com/vatesfr/xen-orchestra/pull/7974))
- [REST API] Add S3 backup repository information in the `/rest/v0/dashboard` endpoint (PR [#7978](https://github.com/vatesfr/xen-orchestra/pull/7978))

### Bug fixes

Expand Down
10 changes: 5 additions & 5 deletions packages/xo-server/src/xo-mixins/remotes.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -174,16 +174,16 @@ export default class {
})
: this.getRemoteHandler(remote.id).then(handler => handler.getInfo())

try {
const sizeUsedForBackup = await Disposable.use(this._app.getBackupsRemoteAdapter(remote), adapter =>
adapter.getTotalBackupSize()
).catch(noop)
const sizeUsedForBackups = await Disposable.use(this._app.getBackupsRemoteAdapter(remote), adapter =>
adapter.getTotalBackupSize()
).catch(noop)

try {
await timeout.call(
promise.then(info => {
remotesInfo[remote.id] = {
...info,
sizeUsedForBackup,
sizeUsedForBackups,
encryption,
}
}),
Expand Down
6 changes: 3 additions & 3 deletions packages/xo-server/src/xo-mixins/rest-api.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -250,14 +250,14 @@ async function _getDashboardStats(app) {
continue
}

const sizeUsedForBackup = remoteInfo.sizeUsedForBackup ?? 0
const sizeUsedForBackups = remoteInfo.sizeUsedForBackups ?? 0
const isS3 = type === 's3'
const target = isS3 ? backupRepositoriesSize.s3 : backupRepositoriesSize.other

target.backups += sizeUsedForBackup
target.backups += sizeUsedForBackups
if (!isS3) {
target.available += remoteInfo.available
target.other += remoteInfo.used - sizeUsedForBackup
target.other += remoteInfo.used - sizeUsedForBackups
target.total += remoteInfo.size
target.used += remoteInfo.used
}
Expand Down

0 comments on commit 4a00286

Please sign in to comment.