fix: close admin channel test sms loop

This commit is contained in:
hectorzhao
2026-07-09 11:49:20 +08:00
parent a4a638208e
commit c58a010951
12 changed files with 582 additions and 17 deletions
+6 -1
View File
@@ -619,13 +619,18 @@ export class SendChainService implements OnModuleInit, OnModuleDestroy {
},
});
await this.recordSubmitSegments(message, data, submittedAt);
const batchTask = await this.prisma.smsBatchTask.findUnique({
where: { id: message.batchTaskId },
select: { sourceType: true },
});
const isAdminChannelTest = batchTask?.sourceType === 'admin_channel_test';
if (data.submitId && message.submitId && data.submitId !== message.submitId) {
return this.prisma.smsMessageRecord.findUnique({ where: { id: message.id } });
}
const status = data.submitStatus === 'accepted' ? 'submitted' : data.submitStatus === 'timeout' ? 'timeout' : 'submit_failed';
if (data.submitStatus === 'accepted') {
await this.chargeAcceptedMessage(message);
} else {
} else if (!isAdminChannelTest) {
const retried = await this.retryMessageIfAllowed(message, data.submitStatus === 'timeout' ? '提交超时补发' : '提交失败补发');
if (retried) {
await this.refreshTaskProgress(message.batchTaskId);