From: Michael Tremer Date: Wed, 26 Apr 2023 17:22:38 +0000 (+0000) Subject: jobs: Send a message to the builder to abort a job X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=aed57811d08c241bc6069adde81423c7e91a15ac;p=pbs.git jobs: Send a message to the builder to abort a job Signed-off-by: Michael Tremer --- diff --git a/src/buildservice/jobs.py b/src/buildservice/jobs.py index d7ebdb94..aaac17b0 100644 --- a/src/buildservice/jobs.py +++ b/src/buildservice/jobs.py @@ -466,6 +466,13 @@ class Job(base.DataObject): """ Aborts the job """ + # Tell the builder to abort the job + if self.connection: + await self.connection.write_message({ + "type" : "abort", + "data" : {}, + }) + # Mark as finished self._set_attribute_now("finished_at") @@ -474,9 +481,6 @@ class Job(base.DataObject): if user: self._set_attribute("aborted_by", user) - # Dispatch more jobs - await self.backend.jobs.queue.dispatch() - def is_aborted(self): """ Returns True if this job has been aborted