fix: run docker build in thread pool to avoid blocking API

This commit is contained in:
Alex Blank
2026-05-27 22:08:01 +02:00
parent bc71fd6fac
commit 1883825b18
+2 -1
View File
@@ -588,7 +588,8 @@ async def create_instance(
image_tag = f"headquarter/{instance_name}:latest".lower()
if tool_type.dockerfile_template:
returncode, stdout, stderr = build_image(
returncode, stdout, stderr = await asyncio.to_thread(
build_image,
instance_dir=instance_dir,
dockerfile=tool_type.dockerfile_template,
tag=image_tag,