link-stack/apps/bridge-worker/lib/utils.ts

27 lines
618 B
TypeScript
Raw Permalink Normal View History

2023-02-13 12:41:30 +00:00
import * as Worker from "graphile-worker";
2024-04-21 16:59:50 +02:00
// import { defState } from "@digiresilience/montar";
//import config from "@digiresilience/bridge-config";
2023-02-13 12:41:30 +00:00
2024-04-21 16:59:50 +02:00
/*
2023-02-13 12:41:30 +00:00
const startWorkerUtils = async (): Promise<Worker.WorkerUtils> => {
const workerUtils = await Worker.makeWorkerUtils({
connectionString: config.worker.connection,
});
return workerUtils;
};
const stopWorkerUtils = async (): Promise<void> => {
return workerUtils.release();
};
const workerUtils = defState("workerUtils", {
start: startWorkerUtils,
stop: stopWorkerUtils,
});
2024-04-21 16:59:50 +02:00
*/
export const workerUtils: any = {};
2023-02-13 12:41:30 +00:00
export default workerUtils;