mirror of
https://github.com/timothymiller/cloudflare-ddns.git
synced 2026-03-21 22:48:57 -03:00
Deduplicate IPs before DNS record update
Remove duplicate IPs before updating DNS records to ensure stable input.
This commit is contained in:
@@ -66,7 +66,10 @@ pub async fn update_once(
|
|||||||
|
|
||||||
// Update DNS records (env var mode - domain-based)
|
// Update DNS records (env var mode - domain-based)
|
||||||
for (ip_type, domains) in &config.domains {
|
for (ip_type, domains) in &config.domains {
|
||||||
let ips = detected_ips.get(ip_type).cloned().unwrap_or_default();
|
let mut ips = detected_ips.get(ip_type).cloned().unwrap_or_default();
|
||||||
|
// FIX: remove duplicates so CloudflareHandle::set_ips sees stable input
|
||||||
|
ips.sort();
|
||||||
|
ips.dedup();
|
||||||
let record_type = ip_type.record_type();
|
let record_type = ip_type.record_type();
|
||||||
|
|
||||||
for domain_str in domains {
|
for domain_str in domains {
|
||||||
|
|||||||
Reference in New Issue
Block a user