self.builder.disconnected()
async def on_message(self, message):
- # Fetch the builder again, because this is being executed as a separate task
- # and therefore we cannot use the object from the previous session.
- builder = await self.backend.builders.get_by_name(self.builder.name)
-
# Decode message
message = self._decode_json_message(message)
if type == "log":
return self.backend.logstreams.log(message)
+ # Fetch the builder again, because this is being executed as a separate task
+ # and therefore we cannot use the object from the previous session.
+ builder = await self.backend.builders.get_by_name(self.builder.name)
+
# Handle stats
- elif type == "stats":
+ if type == "stats":
async with await self.db.transaction():
await builder.log_stats(**data)