2013-10-01 54 views
1

我在Windows Azure中使用移动服务。我使用可用于移动服务的新调度程序。我调用SendOut的调度程序。Windows Azure移动服务调度程序执行超时

我正在运行一个非常简单的脚本,它会将消息插入到队列中。整个脚本:

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)

我想不通为什么我得到这个错误 - 或如何解决它。

难道是因为它运行在免费的移动服务层?

+0

我也看到这个问题。我在过去10天左右见过其他报道。也许这是最近引入的问题。 – dcstraw

回答

0

我不认为这是由于免费的手机订阅。

尝试添加 尝试{}赶上 {}块

和使用的console.log()进行登录,如果发生错误。它可以帮助你解决你的问题。

+0

我已经添加了一些日志记录,现在已将其扩展为完整的try-catch块。这似乎是我得到的错误:var azure = require('azure'); – torstenaa

+0

我在函数中添加了一个try-catch块。正如最初的问题所述,我仍然得到未处理的异常。所以try-catch块不会捕获错误,因为我在日志中看不到任何条目(我将错误打印到日志中)。所以它似乎仍然是要求('天蓝');这给了问题。有任何想法吗? – torstenaa

+0

一个建议,你确定这个错误是由这个特定的脚本抛出吗?我已经遇到了类似的错误,但我怀疑是错误的脚本......所以我的建议如下:在调度器中只用这个脚本创建一个新的移动服务,没有别的。并等待查看错误是否继续。如果没有,你必须检查你的所有脚本,以确保你捕捉到任何错误,否则阻止或捕获,并且你总是发送一个请求的响应 –