我遇到了同样的超时问题,但在实现建议的解决方案时遇到了一些困难,因此我想添加一些细节。
首先,我花了些时间才找到 /var/discourse/templates,因为我的 Discourse 安装在非标准位置。我当时在 Docker 中查找,这当然没有意义。
其次,第 159 行不再正确。我猜您指的是 template.yml 的这一部分:
- exec:
cd: $home
hook: yarn
cmd:
- |-
if [ "$version" != "tests-passed" ]; then
rm -rf app/assets/javascripts/node_modules
fi
- su discourse -c 'yarn install --frozen-lockfile && yarn cache clean'
第三,我对 yaml、pups 和 yarn 不是很熟悉,也不知道它们在 Discourse 中是如何使用的,而且我不想猜测。因此,我尝试对原始部分进行了如下更改:
- exec:
cd: $home
hook: yarn
cmd:
- |-
if [ "$version" != "tests-passed" ]; then
rm -rf app/assets/javascripts/node_modules
fi
- su discourse -c 'yarn config set network-timeout 600000 -g && yarn install --frozen-lockfile && yarn cache clean'
这对我来说是有效的。./launcher rebuild app 现在需要很长时间(对我来说超过 2 小时),但至少它能成功完成,并且论坛又能正常工作了。
最后,我想补充一点,这个问题(对我而言)绝对不是内存不足:我使用的是带有 32GB 内存的 VPS,问题发生时有 24GB 是空闲的。