feat(xo-server/registerHttpRequestHandler): returns teardown function

`unregisterHttpRequestHandler` is no longer useful and has been removed.
This commit is contained in:
Julien Fontanet
2023-11-29 10:58:55 +01:00
parent b856c1a6b4
commit 6f68456bae

View File

@@ -7,6 +7,7 @@ import isEmpty from 'lodash/isEmpty.js'
import iteratee from 'lodash/iteratee.js'
import mixin from '@xen-orchestra/mixin'
import mixinLegacy from '@xen-orchestra/mixin/legacy.js'
import once from 'lodash/once.js'
import stubTrue from 'lodash/stubTrue.js'
import SslCertificate from '@xen-orchestra/mixins/SslCertificate.mjs'
import Tasks from '@xen-orchestra/mixins/Tasks.mjs'
@@ -196,10 +197,10 @@ export default class Xo extends EventEmitter {
fn,
persistent,
}
}
async unregisterHttpRequestHandler(url) {
delete this._httpRequestWatchers[url]
return once(() => {
delete this._httpRequestWatchers[url]
})
}
// -----------------------------------------------------------------