feat(xo-server/api): pending/failed calls have an associated tasks

This commit is contained in:
Julien Fontanet
2024-03-25 16:46:52 +01:00
parent bed18fc954
commit 33a388193c
2 changed files with 5 additions and 1 deletions

View File

@@ -15,6 +15,7 @@
> Users must be able to say: “I had this issue, happy to know it's fixed”
- [V2V] Fix VSAN import not used when importing from VSAN ([PR #7717](https://github.com/vatesfr/xen-orchestra/pull/7717))
- [Tasks] Log pending and failed API calls as XO tasks, eventually they will replaced logs in Settings/Logs
### Packages to release
@@ -35,6 +36,7 @@
- @vates/fuse-vhd patch
- @xen-orchestra/proxy-cli patch
- @xen-orchestra/vmware-explorer patch
- xo-server minor
- xo-server-backup-reports major
- xo-server-netbox minor
- xo-web patch

View File

@@ -363,7 +363,9 @@ export default class Api {
const resolvedParams = await resolveParams.call(app, method, params)
let result = await method.call(app, resolvedParams)
let result = await app.tasks
.create({ name: 'API call: ' + name, method: name, params, type: 'api.call' }, { clearLogOnSuccess: true })
.run(() => method.call(app, resolvedParams))
// If nothing was returned, consider this operation a success
// and return true.