Skip to content

Commit

Permalink
Don't reload twice for SPF record updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jcameron committed Apr 23, 2018
1 parent 61e14b0 commit 08e65eb
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions feature-dns.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2746,9 +2746,10 @@ sub save_domain_spf
local ($d, $spf) = @_;
&require_bind();
local @types = $bind8::config{'spf_record'} ? ( "SPF", "TXT" ) : ( "SPF" );
local ($recs, $file);
&pre_records_change($d);
foreach my $t (@types) {
&pre_records_change($d);
local ($recs, $file) = &get_domain_dns_records_and_file($d);
($recs, $file) = &get_domain_dns_records_and_file($d);
if (!$file) {
# Domain not found!
return;
Expand Down Expand Up @@ -2781,13 +2782,13 @@ sub save_domain_spf
&save_domain($d);
$bump = 1;
}
if ($bump) {
&post_records_change($d, $recs, $file);
&register_post_action(\&restart_bind, $d);
}
else {
&after_records_change($d);
}
}
if ($bump) {
&post_records_change($d, $recs, $file);
&reload_bind_records($d);
}
else {
&after_records_change($d);
}
}

Expand Down

0 comments on commit 08e65eb

Please sign in to comment.