perf(cmpp): reduce inbound database round trips

This commit is contained in:
hectorzhao
2026-08-20 15:29:45 +08:00
parent 67b760a599
commit 14f993c1f8
12 changed files with 153 additions and 24 deletions
@@ -164,10 +164,11 @@ async submitInboundSingleMessage(
data: GatewayInboundSubmitDto & { phoneNumber: string },
messageId: string,
submitGroupMessageId: string,
application: NonNullable<Awaited<ReturnType<SendSubmissionService['findInboundApplication']>>>,
synchronousRejection?: { code: string; reason: string },
receiptRejection?: { code: string; reason: string },
) {
return this.inboundEntry.submitInboundSingleMessage(data, messageId, submitGroupMessageId, synchronousRejection, receiptRejection);
return this.inboundEntry.submitInboundSingleMessage(data, messageId, submitGroupMessageId, application, synchronousRejection, receiptRejection);
}
async evaluateRiskWithPhoneFrequency(input: {
@@ -214,8 +215,8 @@ async runScheduledDispatchScan() {
return this.scheduledDispatch.runScheduledDispatchScan();
}
async enqueueBatchTask(taskId: string) {
return this.gatewaySubmit.enqueueBatchTask(taskId);
async enqueueBatchTask(taskId: string, preparedMessage?: { messageRecordId: string; queuePriority?: string | null }) {
return this.gatewaySubmit.enqueueBatchTask(taskId, preparedMessage);
}
startWorker() {