]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
sources: set reference after loading dump files
authorMiroslav Lichvar <mlichvar@redhat.com>
Wed, 3 Feb 2021 16:41:39 +0000 (17:41 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 4 Feb 2021 16:48:47 +0000 (17:48 +0100)
After loading the dump files with the -r option, immediately perform a
source selection with forced setting of the reference. This shortens the
interval when a restarted server doesn't respond with synchronized time.
It no longer needs to wait for the first measurement from the best
source (which had to pass all the filters).

sources.c

index 04f292c942a16ff327e3ae9757de51ea794a24ee..68d81fe02277d497dc51d6c232e1b68c57b0169b 100644 (file)
--- a/sources.c
+++ b/sources.c
@@ -1455,7 +1455,13 @@ SRC_ReloadSources(void)
 
   for (i = 0; i < n_sources; i++) {
     load_source(sources[i]);
+
+    /* Allow an immediate update of the reference */
+    sources[i]->updates++;
   }
+
+  /* Select sources and set the reference */
+  SRC_SelectSource(NULL);
 }
 
 /* ================================================== */