标题在使用Microsoft.AspNetCore.NodeServices调用JS文件时获得节点调用超时错误
Functional I开发了使用NodeServices的应用程序,并使用以下文章将其部署到Azure上:
它在本地工作,但在部署的版本上不起作用。获取节点超时错误:
The Node invocation timed out after 60000ms.
You can change the timeout duration by setting the InvocationTimeoutMilliseconds property on NodeServicesOptions.
The first debugging step is to ensure that your Node.js function always invokes the supplied callback (or throws an exception synchronously), even if it encounters an error. Otherwise, the .NET code has no way to know that it is finished or has failed. | Source: Microsoft.AspNetCore.NodeServices应创建预期结果 PDF。
实际结果 NodeService抛出超时错误
但在已部署的版本上仍然会出现超时错误。任何帮助都将不胜感激。谢谢。
发布于 2018-05-16 18:59:44
您可以在将NodeServices添加到服务容器时指定超时-您还可以在那里设置一个ILogger,这可能会帮助您调试问题:
services.AddNodeServices(options =>
{
options.InvocationTimeoutMilliseconds = TimeSpan.FromMinutes(5).Milliseconds;
options.NodeInstanceOutputLogger = log;
});发布于 2018-05-16 17:02:52
Azure不支持PhantomJS。更多信息,这里。
最后我使用了用于容器的Azure Web应用程序。
下面是我的博客,介绍如何在ASP.NET Core中使用NodeServices进行处理:链接。
(不过它使用了另一个节点包)。
https://stackoverflow.com/questions/50376225
复制相似问题