fix: close admin channel test sms loop
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user