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.
24 lines
655 B
24 lines
655 B
import { addPriority1RpaJob } from "@/workers/rpa/queue";
|
|
import type { Priority1DemoInput } from "@/workers/rpa/priority1/demo-input";
|
|
|
|
export type Priority1QuoteJobData = {
|
|
quoteId: string;
|
|
requestId: string;
|
|
customerId: string;
|
|
cargoHash: string;
|
|
input: Priority1DemoInput;
|
|
};
|
|
|
|
export async function enqueuePriority1QuoteJob(
|
|
data: Priority1QuoteJobData,
|
|
): Promise<void> {
|
|
if (process.env.RPA_QUEUE_ENABLED === "false") {
|
|
console.log(
|
|
`[priority1-queue] 队列已禁用 quote_id=${data.quoteId}`,
|
|
);
|
|
return;
|
|
}
|
|
await addPriority1RpaJob(data);
|
|
console.log(`[priority1-queue] 已入队 quote_id=${data.quoteId}`);
|
|
}
|