You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using Bree to execute Cron 1 which ingests data from an API to my DB. Cron 2 then executes and uses DB data to spawn several workers operating Cron 3 with different data for each worker. Cron 3 runs on an infinite loop for each worker, even though it has a closeWorkerAfterMs, process.exit(0) command and the parentPort.postMessage('done').
Cron 2: "cronFactory.js"
`
import path from 'path';
import ms from 'ms';
import Bree from 'bree';
import { PrismaClient } from '@prisma/client';
Hello,
I am using Bree to execute Cron 1 which ingests data from an API to my DB. Cron 2 then executes and uses DB data to spawn several workers operating Cron 3 with different data for each worker. Cron 3 runs on an infinite loop for each worker, even though it has a closeWorkerAfterMs, process.exit(0) command and the parentPort.postMessage('done').
Cron 2: "cronFactory.js"
`
import path from 'path';
import ms from 'ms';
import Bree from 'bree';
import { PrismaClient } from '@prisma/client';
const cronFactory = async () => {
const prisma = new PrismaClient();
};
cronFactory();
`
Cron 3: goalUpdate.js
`import { parentPort, workerData } from 'worker_threads';
const goalUpdate = async () => {
if (parentPort) parentPort.postMessage('done');
else process.exit(0);
};
goalUpdate();`
The console output runs infinitely, threadID's keep climbing. Help?
The text was updated successfully, but these errors were encountered: