2016-08-29 36 views
0

在Azure中DocumentDB,运行下一个SP天青DocumentDB,在SP,setTimeout的抛出异常

function sample(prefix) { 
    setTimeout(function() { throw "gg"; }, "1000"); 
} 

抛出下一个异常

Encountered exception while executing Javascript. Exception = ReferenceError: 'setTimeout' is undefined

有没有办法在DocumentDB使用的setTimeout?

+0

您可以参考http://azure.github.io/azure-documentdb-js-server/,documentdb服务器sdk不支持超时功能。 –

回答

0

setTimeout不被支持,但你不应该需要它。引擎将保持活动状态,直到所有待处理的异步操作返回或超时。

如果您向我们提供更多代码,我们可能会告诉您如何在没有setTimeout的情况下执行您正在做的事情。