diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index f4c17b64ea..e03768a420 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: - node-version: [10.x] + node-version: [12.x] steps: - uses: actions/checkout@v2 diff --git a/packages/server/src/workflows/index.js b/packages/server/src/workflows/index.js index 596402ef04..c4e2ad5cd7 100644 --- a/packages/server/src/workflows/index.js +++ b/packages/server/src/workflows/index.js @@ -1,21 +1,21 @@ const triggers = require("./triggers") const environment = require("../environment") -//const workerFarm = require("worker-farm") +const workerFarm = require("worker-farm") const singleThread = require("./thread") -//let workers = workerFarm(require.resolve("./thread")) +let workers = workerFarm(require.resolve("./thread")) -// function runWorker(job) { -// return new Promise((resolve, reject) => { -// workers(job, err => { -// if (err) { -// reject(err) -// } else { -// resolve() -// } -// }) -// }) -// } +function runWorker(job) { + return new Promise((resolve, reject) => { + workers(job, err => { + if (err) { + reject(err) + } else { + resolve() + } + }) + }) +} /** * This module is built purely to kick off the worker farm and manage the inputs/outputs @@ -23,9 +23,9 @@ const singleThread = require("./thread") module.exports.init = function() { triggers.workflowQueue.process(async job => { if (environment.BUDIBASE_ENVIRONMENT === "PRODUCTION") { - //await runWorker(job) - await singleThread(job) + await runWorker(job) } else { + console.log("Testing standard thread") await singleThread(job) } })