Skip to content

BillionMail gives you open-source MailServer, NewsLetter, Email Marketing — fully self-hosted, dev-friendly, and free from monthly fees. Join the discord: https://discord.gg/asfXzBUhZr

Fix shipping progress

lotkd9f2d1bed991
diff --git a/core/internal/service/batch_mail/batch_mail.go b/core/internal/service/batch_mail/batch_mail.go
index 67c35bb2..0462a5ee 100644
--- a/core/internal/service/batch_mail/batch_mail.go
+++ b/core/internal/service/batch_mail/batch_mail.go
@@ -311,7 +311,14 @@ func CreateTaskWithRecipients(ctx context.Context, req *v1.CreateTaskReq, addTyp
}
// update recipient count
- return UpdateRecipientCount(ctx, taskId, totalRecipients)
+ actualCount, err := GetActualRecipientCount(ctx, taskId)
+ if err == nil && actualCount > 0 {
+ err = UpdateRecipientCount(ctx, taskId, actualCount)
+ if err != nil {
+ return gerror.New(public.LangCtx(ctx, "Failed to update recipient count for task {}: {}", taskId, err.Error()))
+ }
+ }
+ return nil
})
if err != nil {