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

Fixed dedicated IP apply status changed when re-getting command.

Jack902748d04892
diff --git a/core/internal/service/multi_ip_domain/multi_ip_domain.go b/core/internal/service/multi_ip_domain/multi_ip_domain.go
index 28bf7fa4..b2bae143 100644
--- a/core/internal/service/multi_ip_domain/multi_ip_domain.go
+++ b/core/internal/service/multi_ip_domain/multi_ip_domain.go
@@ -270,12 +270,16 @@ func (s *MultiIPDomainService) ApplyConfigs(ctx context.Context) (appliedConfigs
// Get IDs from allActiveConfigs
appliedIDs := make([]int, 0, len(allActiveConfigs))
+ toappliedIDs := make([]int, 0, len(allActiveConfigs))
for _, config := range allActiveConfigs {
appliedIDs = append(appliedIDs, gconv.Int(config["id"]))
+ if config["status"] != "applied" {
+ toappliedIDs = append(toappliedIDs, gconv.Int(config["id"]))
+ }
}
- // Update status of all pending configurations to 'applying'
- if err := s.updateStatusByIDs(ctx, appliedIDs, "applying"); err != nil {
+ // If the state is already "applied", then do not change it to "applying".
+ if err = s.updateStatusByIDs(ctx, toappliedIDs, "applying"); err != nil {
return nil, nil, nil, gerror.Wrap(err, "failed to update configuration status to 'applying'")
}