You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
599 B

import { addFlockRpaJob } from "@/workers/rpa/queue";
import type { FlockQuoteInput } from "@/workers/rpa/flock/types";
export type FlockQuoteJobData = {
quoteId: string;
requestId: string;
customerId: string;
cargoHash: string;
input: FlockQuoteInput;
};
export async function enqueueFlockQuoteJob(
data: FlockQuoteJobData,
): Promise<void> {
if (process.env.RPA_QUEUE_ENABLED === "false") {
console.log(`[flock-queue] 队列已禁用 quote_id=${data.quoteId}`);
return;
}
await addFlockRpaJob(data);
console.log(`[flock-queue] 已入队 quote_id=${data.quoteId}`);
}