chiark / gitweb /
core: set finish_timestamp only after all jobs have finished
authorKay Sievers <kay@vrfy.org>
Sun, 24 Nov 2013 18:18:36 +0000 (19:18 +0100)
committerKay Sievers <kay@vrfy.org>
Sun, 24 Nov 2013 18:18:36 +0000 (19:18 +0100)
src/core/manager.c

index f2f473b..b50182b 100644 (file)
@@ -2275,8 +2275,9 @@ void manager_check_finished(Manager *m) {
         if (m->n_running_jobs == 0)
                 m->jobs_in_progress_event_source = sd_event_source_unref(m->jobs_in_progress_event_source);
 
-        if (hashmap_size(m->jobs) > 0 && m->jobs_in_progress_event_source) {
-                sd_event_source_set_time(m->jobs_in_progress_event_source, JOBS_IN_PROGRESS_PERIOD_SEC);
+        if (hashmap_size(m->jobs) > 0) {
+                if (m->jobs_in_progress_event_source)
+                        sd_event_source_set_time(m->jobs_in_progress_event_source, JOBS_IN_PROGRESS_PERIOD_SEC);
                 return;
         }