fix(xo-server): enable async_hooks support in Bluebird (#5635)
Necessary for `@xen-orchestra/backups`.
This commit is contained in:
parent
deb58e40d5
commit
1ff25943dc
@ -18,7 +18,14 @@ try {
|
|||||||
|
|
||||||
// Use Bluebird for all promises as it provides better performance and
|
// Use Bluebird for all promises as it provides better performance and
|
||||||
// less memory usage.
|
// less memory usage.
|
||||||
global.Promise = require('bluebird')
|
const Bluebird = require('bluebird')
|
||||||
|
|
||||||
|
// Enable `async_hooks` because it's used by `@xen-orchestra/backups/Task` via `node-zone`
|
||||||
|
//
|
||||||
|
// See: http://bluebirdjs.com/docs/api/promise.config.html#async-hooks
|
||||||
|
Bluebird.config({ asyncHooks: true })
|
||||||
|
|
||||||
|
global.Promise = Bluebird
|
||||||
|
|
||||||
require('@xen-orchestra/log/configure').catchGlobalErrors(require('@xen-orchestra/log').default('xo:xo-server'))
|
require('@xen-orchestra/log/configure').catchGlobalErrors(require('@xen-orchestra/log').default('xo:xo-server'))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user