Restructure omni services and add Chatwoot research snapshot

This commit is contained in:
Ruslan Bakiev
2026-02-21 11:11:27 +07:00
parent edea7a0034
commit b73babbbf6
7732 changed files with 978203 additions and 32 deletions

View File

@@ -1,8 +0,0 @@
[phases.install]
cmds = ["npm ci --legacy-peer-deps"]
[phases.build]
cmds = ["npm run db:generate", "npm run build"]
[start]
cmd = "npm run preview -- --host 0.0.0.0 --port ${PORT:-3000}"

View File

@@ -53,7 +53,7 @@ export default defineEventHandler(async (event) => {
return {
ok: true,
queue: "omni-outbound",
queue: process.env.SENDER_FLOW_QUEUE_NAME || process.env.OUTBOUND_DELIVERY_QUEUE_NAME || "sender.flow",
jobId: job.id,
omniMessageId,
};

View File

@@ -25,7 +25,7 @@ export default defineEventHandler(async (event) => {
return {
ok: true,
queue: "omni-outbound",
queue: process.env.SENDER_FLOW_QUEUE_NAME || process.env.OUTBOUND_DELIVERY_QUEUE_NAME || "sender.flow",
jobId: job.id,
omniMessageId,
};

View File

@@ -2,7 +2,11 @@ import { Queue, Worker, type JobsOptions, type ConnectionOptions } from "bullmq"
import { Prisma } from "@prisma/client";
import { prisma } from "../utils/prisma";
export const OUTBOUND_DELIVERY_QUEUE_NAME = "omni-outbound";
export const OUTBOUND_DELIVERY_QUEUE_NAME = (
process.env.SENDER_FLOW_QUEUE_NAME ||
process.env.OUTBOUND_DELIVERY_QUEUE_NAME ||
"sender.flow"
).trim();
export type OutboundDeliveryJob = {
omniMessageId: string;

View File

@@ -1,12 +1,12 @@
import { startOutboundDeliveryWorker } from "./outboundDelivery";
import { OUTBOUND_DELIVERY_QUEUE_NAME, startOutboundDeliveryWorker } from "./outboundDelivery";
import { prisma } from "../utils/prisma";
import { getRedis } from "../utils/redis";
const worker = startOutboundDeliveryWorker();
console.log("[delivery-worker] started queue omni:outbound");
console.log(`[omni_outbound(legacy-in-frontend)] started queue ${OUTBOUND_DELIVERY_QUEUE_NAME}`);
async function shutdown(signal: string) {
console.log(`[delivery-worker] shutting down by ${signal}`);
console.log(`[omni_outbound(legacy-in-frontend)] shutting down by ${signal}`);
try {
await worker.close();
} catch {
@@ -32,4 +32,3 @@ process.on("SIGINT", () => {
process.on("SIGTERM", () => {
void shutdown("SIGTERM");
});