x
This commit is contained in:
@@ -123,7 +123,21 @@ class GeometryVerificationService:
|
||||
cwd=str(stp_dir) # 在 STP 文件所在目录运行
|
||||
)
|
||||
|
||||
stdout, stderr = await process.communicate()
|
||||
# 增加超时时间到 300 秒(5分钟)
|
||||
try:
|
||||
stdout, stderr = await asyncio.wait_for(
|
||||
process.communicate(),
|
||||
timeout=300.0
|
||||
)
|
||||
except asyncio.TimeoutError:
|
||||
logger.error("验证脚本执行超时(300秒)")
|
||||
process.kill()
|
||||
await process.wait()
|
||||
return {
|
||||
"status": "error",
|
||||
"error": "验证脚本执行超时(300秒)",
|
||||
"timestamp": datetime.now().isoformat()
|
||||
}
|
||||
|
||||
stdout_text = stdout.decode('utf-8') if stdout else ''
|
||||
stderr_text = stderr.decode('utf-8') if stderr else ''
|
||||
|
||||
Reference in New Issue
Block a user