文件
hyb-oa/server/src/jobs/jobSystem.js
T

30 行
904 B
JavaScript

const { startDelegationRevokeJob } = require("./delegationRevokeJob");
const { startInvoiceArchiveJob } = require("./invoiceArchiveJob");
const { startOcrJob } = require("./ocrJob");
const { startIntegrationOutboxWorker } = require("./integrationOutboxWorker");
const { startErpMasterDataSyncJob } = require("./erpMasterDataSyncJob");
const { startPgBossJobs } = require("./pgBossJobs");
async function startJobs(fastify) {
if (!fastify.config.jobsEnabled) {
fastify.log.info("Jobs disabled");
return { driver: "disabled" };
}
if (fastify.config.jobDriver === "pgboss") {
await startPgBossJobs(fastify);
return { driver: "pgboss" };
}
startDelegationRevokeJob(fastify);
startOcrJob(fastify);
startInvoiceArchiveJob(fastify);
startIntegrationOutboxWorker(fastify);
startErpMasterDataSyncJob(fastify);
return { driver: "cron" };
}
module.exports = {
startJobs,
};