WhatsApp/Signal/Formstack/admin updates
This commit is contained in:
parent
bcecf61a46
commit
d0cc5a21de
451 changed files with 16139 additions and 39623 deletions
|
|
@ -1,18 +1,27 @@
|
|||
import { run } from "graphile-worker";
|
||||
import { createLogger } from "@link-stack/logger";
|
||||
import * as path from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
|
||||
const logger = createLogger("bridge-worker");
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
|
||||
const startWorker = async () => {
|
||||
console.log("Starting worker...");
|
||||
console.log(process.env);
|
||||
logger.info("Starting worker...");
|
||||
|
||||
await run({
|
||||
connectionString: process.env.DATABASE_URL,
|
||||
concurrency: 10,
|
||||
noHandleSignals: false,
|
||||
pollInterval: 1000,
|
||||
concurrency: process.env.BRIDGE_WORKER_CONCURRENCY
|
||||
? parseInt(process.env.BRIDGE_WORKER_CONCURRENCY, 10)
|
||||
: 10,
|
||||
maxPoolSize: process.env.BRIDGE_WORKER_POOL_SIZE
|
||||
? parseInt(process.env.BRIDGE_WORKER_POOL_SIZE, 10)
|
||||
: 10,
|
||||
pollInterval: process.env.BRIDGE_WORKER_POLL_INTERVAL
|
||||
? parseInt(process.env.BRIDGE_WORKER_POLL_INTERVAL, 10)
|
||||
: 1000,
|
||||
taskDirectory: `${__dirname}/tasks`,
|
||||
crontabFile: `${__dirname}/crontab`,
|
||||
});
|
||||
|
|
@ -23,6 +32,15 @@ const main = async () => {
|
|||
};
|
||||
|
||||
main().catch((err) => {
|
||||
console.error(err);
|
||||
logger.error(
|
||||
{
|
||||
error: err,
|
||||
message: err.message,
|
||||
stack: err.stack,
|
||||
name: err.name,
|
||||
},
|
||||
"Worker failed to start",
|
||||
);
|
||||
console.error("Full error:", err);
|
||||
process.exit(1);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue