From f39ec2d96969c6f50c8758308d655589196e007d Mon Sep 17 00:00:00 2001 From: Jake Meyer Date: Fri, 18 Oct 2024 09:49:19 -0700 Subject: [PATCH] Only cache ip updates if all providers succeed --- src/providers/cloudflare.rs | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/providers/cloudflare.rs b/src/providers/cloudflare.rs index 539a50a..5045831 100644 --- a/src/providers/cloudflare.rs +++ b/src/providers/cloudflare.rs @@ -123,8 +123,14 @@ impl Provider for Cloudflare { if updated.success { debug!("Record updated: {:#?}", updated); } else { - error!("Failed to update domain ({}) record: {:#?}", domain.name, updated); - return Err(anyhow!("Failed to update domain ({}) record", domain.name)); + error!( + "Failed to update domain ({}) record: {:#?}", + domain.name, updated + ); + return Err(anyhow!( + "Failed to update domain ({}) record", + domain.name + )); } } else { debug!( @@ -149,8 +155,14 @@ impl Provider for Cloudflare { if created.success { debug!("Record created: {:#?}", created); } else { - error!("Failed to create domain ({}) record: {:#?}", domain.name, created); - return Err(anyhow!("Failed to create domain ({}) record", domain.name)); + error!( + "Failed to create domain ({}) record: {:#?}", + domain.name, created + ); + return Err(anyhow!( + "Failed to create domain ({}) record", + domain.name + )); } }; }