Skip to content

(理论上)解决 [ERROR] [进程5] 翻译 xxx 失败: timed out after 300 seconds #43

Description

@MurthiNext

如果你在翻译过程中出现了以下错误:

[ERROR] [进程5] 翻译 xxx 失败: Command '['H:\\repos\\ForkedRepos\\VoiceTransl\\.venv\\Scripts\\python.exe', 'translate.py', 'project\\cache\\translate_1782110926916234', 'ForGal-json']' timed out after 300 seconds

那么可以尝试自行修复:
app.py 中的第 140 行(我的 feat-devablity-optimization 分支中为第 144 行),删除 timeout=300

result = subprocess.run([*_TRANSLATE_CMD, workspace, engine],
                       check=True, capture_output=True, text=True, timeout=300, creationflags=creationflags)

修改后为以下内容,超时模块由线程池与 GalTransl 内部 API 解决:

result = subprocess.run([*_TRANSLATE_CMD, workspace, engine],
                       check=True, capture_output=True, text=True, creationflags=creationflags)

不过通常而言(经过我的测试),源代码无法直接 python app.py 运行,这在我的分支 feat-devablity-optimization 中已得到解决,不过其目前仍在开发中,急用的可以自己调试一下。
此问题较为严重,或许需要考虑编译一个 hotfix 版本(因为其本身也较好解决)。
@shinnpuru

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions