Skip to content

Commit

Permalink
fix: remove (now) useless worker thread support check (#1406)
Browse files Browse the repository at this point in the history
Co-authored-by: andrew <andrew@emergetools.com>
  • Loading branch information
dnalborczyk and andrew committed May 12, 2022
1 parent ed9d6cd commit 1b2ae00
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions src/lambda/handler-runner/HandlerRunner.js
Expand Up @@ -7,7 +7,6 @@ import {
supportedJava,
supportedGo,
} from '../../config/index.js'
import { satisfiesVersionRange } from '../../utils/index.js'

export default class HandlerRunner {
#env = null
Expand Down Expand Up @@ -101,9 +100,6 @@ export default class HandlerRunner {
}

if (useWorkerThreads) {
// worker threads
this._verifyWorkerThreadCompatibility()

const { default: WorkerThreadRunner } = await import(
'./worker-thread-runner/index.js'
)
Expand Down Expand Up @@ -163,37 +159,6 @@ export default class HandlerRunner {
throw new Error('Unsupported runtime')
}

_verifyWorkerThreadCompatibility() {
const { node: currentVersion } = process.versions
const requiredVersionRange = '>=11.7.0'

const versionIsSatisfied = satisfiesVersionRange(
currentVersion,
requiredVersionRange,
)

// we're happy
if (!versionIsSatisfied) {
if (this.log) {
this.log.warning(
`"worker threads" require node.js version ${requiredVersionRange}, but found version ${currentVersion}.
To use this feature you have to update node.js to a later version.
`,
)
} else {
logWarning(
`"worker threads" require node.js version ${requiredVersionRange}, but found version ${currentVersion}.
To use this feature you have to update node.js to a later version.
`,
)
}

throw new Error(
'"worker threads" are not supported with this node.js version',
)
}
}

// TEMP TODO FIXME
isDockerRunner() {
return this.#runner && this.#runner.constructor.name === 'DockerRunner'
Expand Down

0 comments on commit 1b2ae00

Please sign in to comment.