link-stack/apps/bridge-worker/index.ts

27 lines
593 B
TypeScript
Raw Normal View History

2024-05-14 15:31:44 +02:00
import { run } from "graphile-worker";
import * as path from "path";
import { fileURLToPath } from "url";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const startWorker = async () => {
await run({
connectionString: process.env.DATABASE_URL,
concurrency: 10,
noHandleSignals: false,
pollInterval: 1000,
taskDirectory: `${__dirname}/tasks`,
// crontabFile: `${__dirname}/crontab`,
});
};
const main = async () => {
await startWorker();
};
main().catch((err) => {
console.error(err);
process.exit(1);
});