X-Git-Url: https://git.octo.it/?p=collection4.git;a=blobdiff_plain;f=src%2Fgraph_list.c;h=02c7de8db75f0b2c0fad8042b0cb7abf498a4ae1;hp=b40547692441a39a39ea9e86b35fcdc9694cbd98;hb=e9eb34b5312bf4f2ba915846ccaa35a825585980;hpb=15fc8e0d4c830e05437ff068bb75a67fe5ea46b9 diff --git a/src/graph_list.c b/src/graph_list.c index b405476..02c7de8 100644 --- a/src/graph_list.c +++ b/src/graph_list.c @@ -780,8 +780,8 @@ int gl_config_submit (void) /* {{{ */ return (0); } /* }}} int graph_config_submit */ -int gl_graph_get_all (graph_callback_t callback, /* {{{ */ - void *user_data) +int gl_graph_get_all (_Bool include_dynamic, /* {{{ */ + graph_callback_t callback, void *user_data) { size_t i; @@ -799,6 +799,9 @@ int gl_graph_get_all (graph_callback_t callback, /* {{{ */ return (status); } + if (!include_dynamic) + return (0); + for (i = 0; i < gl_dynamic_num; i++) { int status; @@ -1084,6 +1087,11 @@ int gl_update (_Bool request_served) /* {{{ */ if ((status != 0) || ((gl_last_update + UPDATE_INTERVAL) < now)) { + /* Clear state */ + gl_clear_instances (); + gl_clear_hosts (); + gl_destroy (&gl_dynamic, &gl_dynamic_num); + status = fs_scan (/* callback = */ gl_register_file, /* user data = */ NULL); gl_last_update = now;