From: Michael Tremer Date: Wed, 5 Feb 2025 09:42:34 +0000 (+0000) Subject: jobs: Drop unused control connection stuff X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01e7381fec2281e45870bd560139c79a0af96422;p=pbs.git jobs: Drop unused control connection stuff Signed-off-by: Michael Tremer --- diff --git a/src/buildservice/jobs.py b/src/buildservice/jobs.py index ce5dc1f3..a3eab9bb 100644 --- a/src/buildservice/jobs.py +++ b/src/buildservice/jobs.py @@ -38,8 +38,6 @@ JobPackage = sqlalchemy.Table( ) class Jobs(base.Object): - connections = {} - def init(self): # Setup queue self.queue = Queue(self.backend) @@ -688,43 +686,6 @@ class Job(database.Base, database.BackendMixin, database.SoftDeleteMixin): }, }) - def connected(self, connection): - """ - Called when a builder has connected - """ - # Replace any old connections - if self.connection: - log.warning("Closing connection to %s because it is being replaced" % self) - - # Close the previous connection - self.connection.close(code=1000, reason="Replaced by a new connection") - - log.debug("Connection opened for %s" % self) - - # Store the connection - self.backend.jobs.connections[self.uuid] = connection - - def disconnected(self): - """ - Called when a builder has disconnected - """ - log.debug("%s has disconnected" % self) - - try: - del self.backend.jobs.connections[self.uuid] - except IndexError: - pass - - @property - def connection(self): - """ - Easy access to the control connection to a builder - """ - try: - return self.backend.jobs.connections[self.uuid] - except KeyError: - pass - async def finished(self, success, packages=None, message=None, logfile=None): """ Called when this job has finished