]> git.itanic.dy.fi Git - rrdd/commitdiff
main.c: Enable job control
authorTimo Kokkonen <timo.t.kokkonen@iki.fi>
Sun, 15 Apr 2012 18:18:39 +0000 (21:18 +0300)
committerTimo Kokkonen <timo.t.kokkonen@iki.fi>
Sun, 15 Apr 2012 18:18:39 +0000 (21:18 +0300)
Start using the new job control feature. No need to sleep any more
fixed sleeps. The job scheduler will use epoll_wait timeout for
sleeping instead.

Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
main.c

diff --git a/main.c b/main.c
index 34e201aa9d143ccef9a3ec93b283c396fd17ce9b..cde3010aa6c4e523ecc48aec7bcbb172153d5cff 100644 (file)
--- a/main.c
+++ b/main.c
@@ -17,6 +17,8 @@ int main(int argc, char *argv[])
 
        rrdtool_create_missing_databases(all_rrds);
 
+       init_max_jobs(0);
+
        while (1) {
                pr_info("loop start\n");
                /*
@@ -26,16 +28,10 @@ int main(int argc, char *argv[])
                                               &all_rrds)))
                        rrdtool_update_data(db);
 
-               /*
-                * Let the updates finish
-                */
-               if (harvest_zombies(0))
-                       continue;
-
                sleeptime = get_next_update((struct rrd_database **)&all_rrds);
-               pr_info("Time to sleep %d seconds\n", sleeptime);
-               sleep(sleeptime);
 
+               pr_info("Time to sleep %d seconds\n", sleeptime);
+               poll_job_requests(sleeptime);
        }
        return 0;
 }