我正在 Windows Azure 中使用移动服务。我使用可用于移动服务的新调度程序。我将调度程序称为 SendOut。
我正在运行一个非常简单的脚本,它将向队列插入一条消息。整个脚本:
function SendOut() {
var azure = require('azure');
var queueService = azure.createQueueService("mailsoutscheduler", "[The key to the storage]");
queueService.createQueueIfNotExists("mailsout", function(error){ });
queueService.createMessage("mailsout", "SendOut", function(error){});
}
当我尝试运行脚本一次时,它工作正常。它计划每 5 分钟运行一次。通常一切都很顺利。但是有时我会收到此错误:
An unhandled exception occurred. Error: One of your scripts caused the service to become unresponsive and the service was restarted. This is commonly caused by a script executing an infinite loop or a long, blocking operation. The service was restarted after the script continuously executed for longer than 1000 milliseconds. at EventEmitter. (C:\DWASFiles\Sites\VogSendOut\VirtualDirectory0\site\wwwroot\runtime\server.js:84:17) at EventEmitter.emit (events.js:88:20)
我不明白为什么会出现此错误 - 或者如何解决它。
可能是因为它在免费移动服务层中运行吗?
最佳答案
我认为这不是因为免费的移动订阅。
尝试添加一个 尝试{} catch{} block
并使用 console.log() 记录是否发生错误。它可以帮助您解决问题。
关于node.js - Windows Azure 移动服务调度程序执行超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19118515/