fd_set readset, writeset;
struct timeval tv;
int r, maxfd;
- time_t last_ping_check, last_config_check;
+ time_t last_ping_check, last_config_check, last_graph_dump;
event_t *event;
cp();
last_ping_check = now;
last_config_check = now;
+ last_graph_dump = now;
+
srand(now);
running = true;
while((event = get_expired_event())) {
event->handler(event->data);
- free(event);
+ free_event(event);
}
if(sigalrm) {
if(c->outgoing) {
free(c->outgoing->name);
- freeaddrinfo(c->outgoing->ai);
+ if(c->outgoing->ai)
+ freeaddrinfo(c->outgoing->ai);
free(c->outgoing);
c->outgoing = NULL;
}
try_outgoing_connections();
}
+
+ /* Dump graph if wanted every 60 seconds*/
+
+ if(last_graph_dump + 60 < now) {
+ dump_graph();
+ last_graph_dump = now;
+ }
}
return 0;