Skip to content

Commit

Permalink
chore(gatsby): Convert utils/worker/pool to typescript (#22150)
Browse files Browse the repository at this point in the history
  • Loading branch information
kawamataryo authored Mar 11, 2020
1 parent 66a0933 commit ccf0971
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 16 deletions.
2 changes: 1 addition & 1 deletion packages/gatsby/src/commands/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const telemetry = require(`gatsby-telemetry`)
const { store, emitter, readState } = require(`../redux`)
const queryUtil = require(`../query`)
import * as appDataUtil from "../utils/app-data"
const WorkerPool = require(`../utils/worker/pool`)
import * as WorkerPool from "../utils/worker/pool"
const { structureWebpackErrors } = require(`../utils/webpack-error-utils`)
const {
waitUntilAllJobsComplete: waitUntilAllJobsV2Complete,
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby/src/commands/develop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import chalk from "chalk"
import address from "address"
import cors from "cors"
import telemetry from "gatsby-telemetry"
import WorkerPool from "../utils/worker/pool"
import * as WorkerPool from "../utils/worker/pool"
import http from "http"
import https from "https"

Expand Down
14 changes: 0 additions & 14 deletions packages/gatsby/src/utils/worker/pool.js

This file was deleted.

10 changes: 10 additions & 0 deletions packages/gatsby/src/utils/worker/pool.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import Worker from "jest-worker"
import { cpuCoreCount } from "gatsby-core-utils"

export const create = (): Worker =>
new Worker(require.resolve(`./child`), {
numWorkers: cpuCoreCount(),
forkOptions: {
silent: false,
},
})

0 comments on commit ccf0971

Please sign in to comment.