Changeset 524
- Timestamp:
- 06/12/13 17:48:53 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB.pm
r523 r524 208 208 perpage => 15, 209 209 max_fcgi_requests => 100, # reasonable default? 210 force_refresh => 1, 210 211 ); 211 212 … … 235 236 }; 236 237 bless $self, $class; 238 239 # Several settings are booleans. Handle multiple possible ways of setting them. 240 for my $boolopt ('log_failures', 'force_refresh') { 241 if ($self->{$boolopt} ne '1' && $self->{$boolopt} ne '0') { 242 # true/false, on/off, yes/no all valid. 243 if ($self->{$boolopt} =~ /^(?:true|false|t|f|on|off|yes|no)$/) { 244 if ($self->{$boolopt} =~ /(?:true|t|on|yes)/) { 245 $self->{$boolopt} = 1; 246 } else { 247 $self->{$boolopt} = 0; 248 } 249 } else { 250 warn "Bad $boolopt setting $self->{$boolopt}\n"; 251 $self->{$boolopt} = 1; 252 } 253 } 254 } 237 255 238 256 # Try to connect to the DB, and initialize a number of handy globals. … … 1289 1307 $cfg->{rpcmode} = $1 if /^rpc_mode\s*=\s*(socket|HTTP|XMLRPC)\s*$/i; 1290 1308 $cfg->{maxfcgi} = $1 if /^max_fcgi_requests\s*=\s*(\d+)\s*$/i; 1309 $cfg->{force_refresh} = $1 if /^force_refresh\s*=\s*([a-z01]+)/i; 1291 1310 if (my ($tmp) = /^rpc_iplist\s*=\s*(.+)/i) { 1292 1311 my @ips = split /[,\s]+/, $tmp; … … 4920 4939 4921 4940 # only update the cache file if the zone has changed, or if the cache file has nothing in it. 4922 if ($ changed || !-e $cachefile || -z $cachefile) {4941 if ($self->{force_refresh} || $changed || !-e $cachefile || -z $cachefile) { 4923 4942 open ZONECACHE, ">$tmpcache" or die "Error creating temporary file $tmpcache: $!\n"; 4924 4943 … … 5001 5020 5002 5021 # only update the cache file if the zone has changed, or if the cache file has nothing in it. 5003 if ($ changed || !-e $cachefile || -z $cachefile) {5022 if ($self->{force_refresh} || $changed || !-e $cachefile || -z $cachefile) { 5004 5023 open ZONECACHE, ">$tmpcache" or die "Error creating temporary file $tmpcache: $!\n"; 5005 5024
Note:
See TracChangeset
for help on using the changeset viewer.