]> git.ipfire.org Git - pbs.git/commitdiff
logstreams: Ensure that clients leave correctly
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 4 May 2023 14:53:34 +0000 (14:53 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 4 May 2023 14:53:34 +0000 (14:53 +0000)
on_close() is not a coroutine.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/buildservice/logstreams.py
src/web/jobs.py

index b8be6cd997e95038a82f4f4f5f0acf5952e1eee1..0f89c6a72ba1d0b18d90c91966705e1562bbc6b2 100644 (file)
@@ -110,7 +110,7 @@ class LogStream(base.Object):
 
                log.debug("%s has joined the stream for %s" % (consumer, self.job))
 
-       async def leave(self, consumer):
+       def leave(self, consumer):
                """
                        Called when a consumer wants to leave the stream
                """
index 19eecf2159986d71f90d99dceab8472f7c0626b6..fae68cbf19821c4f323479043ca90a94cd31af88 100644 (file)
@@ -118,11 +118,11 @@ class APIv1LogStreamHandler(base.BackendMixin, tornado.websocket.WebSocketHandle
                # Send messages without any delay
                self.set_nodelay(True)
 
-       async def on_close(self):
+       def on_close(self):
                """
                        Leave the stream
                """
-               await self.stream.leave(self)
+               self.stream.leave(self)
 
        async def message(self, message):
                """