# Discourse 自动化插件因“内部服务器错误”而失效

**URL:** <https://meta.discourse.org/t/discourse-automation-plugin-failing-with-an-internal-server-error/361207>\
**Category:** Bug\
**Tags:** automation\
**Created:** [2025年四月10日 08:06 UTC](https://meta.discourse.org/t/discourse-automation-plugin-failing-with-an-internal-server-error/361207 "2025-04-10T08:06:36Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)\
**Post date:** [2025年四月10日 08:51 UTC](https://meta.discourse.org/t/discourse-automation-plugin-failing-with-an-internal-server-error/361207/4 "2025-04-10T08:51:01Z")

</div>

感谢您的报告。我认为您还有另一个错误，但我们添加的统计代码隐藏了它。

这应该可以解决问题：

> <https://github.com/discourse/discourse/pull/32254>
>
> The previous code could attempt to log a \`nil\` \`run\_time\` if the block would rai…se an exception. This commit adds two safeguards:
> 
> \- rescue any exception to still compute \`run\_time\`
> \- defaults to \`0\` if we still don't have any \`run\_time\`

然后我们就能看到实际的错误了。

---

_[View the full topic](https://meta.discourse.org/t/discourse-automation-plugin-failing-with-an-internal-server-error/361207)._
