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.

26 lines
708 B

import { addMsRefineDetailsJob } from "@/workers/rpa/queue";
import type { NormalizedCargo } from "@/modules/quote/types";
export type MsRefineDetailsJobData = {
quoteId: string;
requestId: string;
customerId: string;
sessionId: string;
cargo: NormalizedCargo;
};
export async function enqueueMsRefineDetailsJob(
data: MsRefineDetailsJobData,
): Promise<void> {
if (process.env.RPA_QUEUE_ENABLED === "false") {
console.log(
`[rpa-queue] 队列已禁用 ms-refine quote_id=${data.quoteId}`,
);
return;
}
await addMsRefineDetailsJob(data);
console.log(
`[rpa-queue] 已入队 ms-refine-details quote_id=${data.quoteId} session=${data.sessionId.slice(0, 8)}`,
);
}