diff options
author | Erich Eckner <git@eckner.net> | 2020-02-07 10:26:44 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2020-02-07 10:26:44 +0100 |
commit | 87bc0f64e575a88a5ad980d9c88ad933a4c66a02 (patch) | |
tree | 9503e15abcdada800da5571707e644fdf84eac35 /anzeige.c | |
parent | 6af672d8d338e290e65d557231362f34e0e4e8f5 (diff) | |
download | anzeige-87bc0f64e575a88a5ad980d9c88ad933a4c66a02.tar.xz |
anzeige.c: query dns more often to make entries in bind quasi-permanent (?)
Diffstat (limited to 'anzeige.c')
-rw-r--r-- | anzeige.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -10,6 +10,7 @@ #include <pthread.h> #include <signal.h> #include <time.h> +#include <netdb.h> #include "fonts.h" #include "input_gadgets.h" @@ -20,6 +21,7 @@ void handle_signals(int signo); t_scroll_data scroll_data; time_t next_update = 0; +time_t next_dns_query = 0; int main(int argc, char **argv) { @@ -80,6 +82,7 @@ int main(int argc, char **argv) } if ((time(NULL) >= next_update) && (scroll_data . update == 0)) { next_update = time(NULL) + 600; // 10 minutes ahead + next_dns_query = time(NULL) + 30; // 1/2 minute ahead memset(text_buffer, 0, TEXT_BUFFER_LENGTH); @@ -148,6 +151,13 @@ int main(int argc, char **argv) ); scroll_data . update = 1; } + if (time(NULL) >= next_dns_query) { + next_dns_query = time(NULL) + 30; // 1/2 minute ahead + gethostbyname("wetter.mb.fh-jena.de"); + gethostbyname("api.met.no"); + gethostbyname("opendata.dwd.de"); + gethostbyname("kpi.ddns.eckner.net"); + } usleep(100000); } |