chore(xo-server): delete unused workers mixin (#5654)
Due to 0811da9014
This commit is contained in:
@@ -139,12 +139,6 @@ timeout = 600e3
|
||||
# see https:#github.com/vatesfr/xen-orchestra/issues/3419
|
||||
# useSudo = false
|
||||
|
||||
|
||||
# https://github.com/facebook/jest/blob/master/packages/jest-worker/README.md#options-object-optional
|
||||
#
|
||||
#[workerOptions]
|
||||
#numWorkers = 2
|
||||
|
||||
[selfService]
|
||||
|
||||
# If true, a snapshot of a Self Service VM will consume as much resources as a
|
||||
|
||||
@@ -87,7 +87,6 @@
|
||||
"human-format": "^0.11.0",
|
||||
"is-redirect": "^1.0.0",
|
||||
"iterable-backoff": "^0.1.0",
|
||||
"jest-worker": "^26.3.0",
|
||||
"js-yaml": "^3.10.0",
|
||||
"json-rpc-peer": "^0.17.0",
|
||||
"json-stringify-safe": "^5.0.1",
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
import Worker from 'jest-worker'
|
||||
|
||||
export default class Workers {
|
||||
get worker() {
|
||||
return this._worker
|
||||
}
|
||||
|
||||
constructor(app, config) {
|
||||
app.on('start', () => {
|
||||
process.env.XO_CONFIG = JSON.stringify(config)
|
||||
|
||||
this._worker = new Worker(require.resolve('./worker'), config.workerOptions)
|
||||
})
|
||||
app.on('stop', () => this._worker.end())
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
// @flow
|
||||
|
||||
import defer from 'golike-defer'
|
||||
import { type Remote, getHandler } from '@xen-orchestra/fs'
|
||||
import { mergeVhd as mergeVhd_ } from 'vhd-lib'
|
||||
|
||||
// Use Bluebird for all promises as it provides better performance and
|
||||
// less memory usage.
|
||||
//
|
||||
// $FlowFixMe
|
||||
global.Promise = require('bluebird')
|
||||
|
||||
// $FlowFixMe
|
||||
const config: Object = JSON.parse(process.env.XO_CONFIG)
|
||||
|
||||
export const mergeVhd = defer(async function (
|
||||
$defer: any,
|
||||
parentRemote: Remote,
|
||||
parentPath: string,
|
||||
childRemote: Remote,
|
||||
childPath: string
|
||||
) {
|
||||
const parentHandler = getHandler(parentRemote, config.remoteOptions)
|
||||
const childHandler = getHandler(childRemote, config.remoteOptions)
|
||||
|
||||
await parentHandler.sync()
|
||||
$defer.call(parentHandler, 'forget')
|
||||
|
||||
await childHandler.sync()
|
||||
$defer.call(childHandler, 'forget')
|
||||
|
||||
return mergeVhd_(parentHandler, parentPath, childHandler, childPath)
|
||||
})
|
||||
@@ -11152,7 +11152,7 @@ jest-worker@^24.6.0, jest-worker@^24.9.0:
|
||||
merge-stream "^2.0.0"
|
||||
supports-color "^6.1.0"
|
||||
|
||||
jest-worker@^26.3.0, jest-worker@^26.6.2:
|
||||
jest-worker@^26.6.2:
|
||||
version "26.6.2"
|
||||
resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-26.6.2.tgz#7f72cbc4d643c365e27b9fd775f9d0eaa9c7a8ed"
|
||||
integrity sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==
|
||||
|
||||
Reference in New Issue
Block a user