]> err.no Git - systemd/commitdiff
job: start job timeout on enqueuing not when we start to process a job
authorLennart Poettering <lennart@poettering.net>
Thu, 24 Feb 2011 01:41:34 +0000 (02:41 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 24 Feb 2011 01:41:38 +0000 (02:41 +0100)
This practically reverses 23e1e0c4a3bc93fb841ac9575953ed5d0ef5282d.

This makes it easier to timeout individual jobs so that this timeout can
be relied on, since blocked dependencies will not influence the timeout.

src/job.c
src/manager.c

index 53c47d4a724fe8388f4878c0fa83596a7fbf1e25..7470204710b2c3e282527a10b3a75a18145888b1 100644 (file)
--- a/src/job.c
+++ b/src/job.c
@@ -461,8 +461,6 @@ int job_run_and_invalidate(Job *j) {
                         j->state = JOB_WAITING;
                 else if (r < 0)
                         r = job_finish_and_invalidate(j, JOB_FAILED);
-                else
-                        job_start_timer(j);
         }
 
         return r;
index 6759bbac975c3e22ed8fe1b46b40a1976c5d9dcf..f266aaa01c652d8ce2d2e6da24cabed5fc512cfe 100644 (file)
@@ -1216,6 +1216,7 @@ static int transaction_apply(Manager *m) {
 
                 job_add_to_run_queue(j);
                 job_add_to_dbus_queue(j);
+                job_start_timer(j);
 
                 log_debug("Installed new job %s/%s as %u", j->unit->meta.id, job_type_to_string(j->type), (unsigned) j->id);
         }