]> git.ipfire.org Git - pbs.git/commitdiff
jobs: Store control connections by their UUID
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 26 Jan 2025 17:27:35 +0000 (17:27 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 26 Jan 2025 17:27:35 +0000 (17:27 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/buildservice/jobs.py

index 69ed82294c671b82a5354ffad5f7b0e2e291c568..cbc14e636d947ed2999a18e70e2f70736914e6da 100644 (file)
@@ -699,10 +699,10 @@ class Job(database.Base, database.BackendMixin, database.SoftDeleteMixin):
                        # Close the previous connection
                        self.connection.close(code=1000, reason="Replaced by a new connection")
 
-               log.debug("Connection opened for %s by %s" % (self, connection.builder))
+               log.debug("Connection opened for %s" % self)
 
                # Store the connection
-               self.backend.jobs.connections[self] = connection
+               self.backend.jobs.connections[self.uuid] = connection
 
        def disconnected(self):
                """
@@ -711,7 +711,7 @@ class Job(database.Base, database.BackendMixin, database.SoftDeleteMixin):
                log.debug("%s has disconnected" % self)
 
                try:
-                       del self.backend.jobs.connections[self]
+                       del self.backend.jobs.connections[self.uuid]
                except IndexError:
                        pass
 
@@ -721,7 +721,7 @@ class Job(database.Base, database.BackendMixin, database.SoftDeleteMixin):
                        Easy access to the control connection to a builder
                """
                try:
-                       return self.backend.jobs.connections[self]
+                       return self.backend.jobs.connections[self.uuid]
                except KeyError:
                        pass