node.js - Windows Azure 移动服务调度程序执行超时

标签 node.js azure scheduler azure-mobile-services

我正在 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/

相关文章:

amazon-web-services - 使用 Terraform 在新创建的虚拟机上创建 Docker 容器

azure - 如何在 Azure 中安装从 GoDaddy 购买的 SSL 证书

Tomcat 7 Cluster with loadbalancing 只需要在一个节点上运行一个服务

c - Windows线程调度器不公平?

javascript - 如何使用 Node 快速测试嵌套 bool 值的存在和值?

node.js - 在 Log4js 中禁用控制台打印

node.js - 如何在 pm2 集群中使用 ParseLiveQuery?

node.js - 如何在nodejs中返回响应?

azure - Mac 中的 Powershell 问题

ruby-on-rails - 在使用 rufus、Resque 或 whenever scheduler 时,它们的优缺点是什么?