Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CentralNic
rdnsd
Commits
1eac3f52
Unverified
Commit
1eac3f52
authored
Jul 31, 2019
by
Gavin Brown
Browse files
call update_stats() before sleeping
parent
aeb02e14
Changes
1
Hide whitespace changes
Inline
Side-by-side
rdnsd
View file @
1eac3f52
...
...
@@ -169,12 +169,16 @@ sub main_loop {
my
$t0
=
time
();
#
# spawn threads
#
my
%threads
;
foreach
my
$ns
(
sort
(
@SERVERS
))
{
#
# resolve nameserver to IP addresses in the main thread
#
my
@ips
=
resolve
(
$ns
,
$CONF
->
{'
AddressFamily
'});
#
# spawn thread
#
$threads
{
$ns
}
=
threads
->
create
(
\
&time_query
,
(
$CONF
->
{'
AddressFamily
'},
$CONF
->
{'
Protocol
'},
,
@ips
));
}
...
...
@@ -193,17 +197,17 @@ sub main_loop {
}
}
#
# update stats
#
update_stats
()
if
(
time
()
-
$UPDATED
>=
$CONF
->
{'
UpdateInterval
'});
my
$dt
=
(
time
()
-
$t0
);
#
# sleep if we need to
#
sleep
(
$CONF
->
{'
Loop
'}
-
$dt
)
if
(
$dt
<
$CONF
->
{'
Loop
'});
#
# update stats
#
update_stats
()
if
(
time
()
-
$UPDATED
>=
$CONF
->
{'
UpdateInterval
'});
};
if
(
$@
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment