2013-10-01 59 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

一個建議,你確定這個錯誤是由這個特定的腳本拋出嗎?我已經遇到了類似的錯誤,但我懷疑是錯誤的腳本......所以我的建議如下:在調度器中只用這個腳本創建一個新的移動服務,沒有別的。並等待查看錯誤是否繼續。如果沒有,你必須檢查你的所有腳本,以確保你捕捉到任何錯誤,否則阻止或捕獲,並且你總是發送一個請求的響應 –