在 TeamCity 中慢 "File Content Replacer"

Slow "File Content Replacer" in TeamCity

我们正在使用 TeamCity 的构建功能 File Content Replacer 来替换多个 AssemblyVersion.cs 文件中的构建版本号,遵循 TeamCity 关于 Changing only the last version part / build number of the AssemblyVersion attribute: 的文档。

我们的文件列表如下所示:

CommonAssemblyInfo.cs
**\Properties\AssemblyInfo.cs

它有效,但有时甚至需要 10 分钟才能开始。这通常发生在构建没有 运行 24 小时或更长时间时,但有时也会发生在随后的构建中。

知道为什么会这样吗?我们也有多个项目具有完全相同的设置,但这种情况从未发生过。

弄清楚了,它击中了可怕的 node_modules 文件夹,里面有 40k+ 个文件。调整文件列表模式以排除文件夹,现在它在 5 秒内完成。

为了将来参考,这里是我们的流程文件列表

CommonAssemblyInfo.cs
+:**/Properties/AssemblyInfo.cs
-:**/node_modules