chore: makes sure end_all_traces run concurrently

This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-06-26 18:10:53 -03:00
commit 0c2251baf5

View file

@ -343,10 +343,10 @@ class Graph:
except Exception as exc:
logger.exception(exc)
tb = traceback.format_exc()
await self.end_all_traces(error=f"{exc.__class__.__name__}: {exc}\n\n{tb}")
asyncio.create_task(self.end_all_traces(error=f"{exc.__class__.__name__}: {exc}\n\n{tb}"))
raise ValueError(f"Error running graph: {exc}") from exc
finally:
await self.end_all_traces()
asyncio.create_task(self.end_all_traces())
# Get the outputs
vertex_outputs = []
for vertex in self.vertices: