fix: run docker build in thread pool to avoid blocking API
This commit is contained in:
@@ -588,7 +588,8 @@ async def create_instance(
|
|||||||
image_tag = f"headquarter/{instance_name}:latest".lower()
|
image_tag = f"headquarter/{instance_name}:latest".lower()
|
||||||
|
|
||||||
if tool_type.dockerfile_template:
|
if tool_type.dockerfile_template:
|
||||||
returncode, stdout, stderr = build_image(
|
returncode, stdout, stderr = await asyncio.to_thread(
|
||||||
|
build_image,
|
||||||
instance_dir=instance_dir,
|
instance_dir=instance_dir,
|
||||||
dockerfile=tool_type.dockerfile_template,
|
dockerfile=tool_type.dockerfile_template,
|
||||||
tag=image_tag,
|
tag=image_tag,
|
||||||
|
|||||||
Reference in New Issue
Block a user