fix(xo-server/worker): sync the remote handlers

Fixes #3739
This commit is contained in:
Julien Fontanet 2018-12-17 17:59:41 +01:00
parent 82253509d0
commit 27409f4fd5

View File

@ -12,16 +12,18 @@ global.Promise = require('bluebird')
// $FlowFixMe
const config: Object = JSON.parse(process.env.XO_CONFIG)
export function mergeVhd(
export async function mergeVhd(
parentRemote: Remote,
parentPath: string,
childRemote: Remote,
childPath: string
) {
return mergeVhd_(
getHandler(parentRemote, config.remoteOptions),
parentPath,
getHandler(childRemote, config.remoteOptions),
childPath
)
const parentHandler = getHandler(parentRemote, config.remoteOptions)
const childHandler = getHandler(childRemote, config.remoteOptions)
// DO NOT forget the handlers as it they are still in use in the main process
await parentHandler.sync()
await childHandler.sync()
return mergeVhd_(parentHandler, parentPath, childHandler, childPath)
}