ArangoDB游标超时 [英] ArangoDB Cursor Timeout
问题描述
使用ArangoDB 2.3.1.看来我的光标在几分钟之内即将到期.我希望他们持续一个小时.我已经使用TTL参数设置了我的AQL查询对象,如下所示:
Using ArangoDB 2.3.1. It seems my cursors are expiring within a couple minutes. I would like them to last for an hour. I've set up my AQL query object with the TTL parameter as follows:
{
"query": 'removed actual query',
"count": true,
"batchSize": 5,
"ttl": 3600000
}
我的理解是TTL参数应该告诉服务器将服务器保持3600000毫秒或1小时.但它会在约60秒内过期.实际上,我已经尝试将TTL更改为几个不同的数字,并且它似乎没有任何作用.有什么想法吗?
My understanding is that the TTL parameter should tell the server to keep the server for 3600000 milliseconds or 1 hour. But it expires within about 60 seconds. In fact, I've tried changing the TTL to several different numbers and it doesn't seem to do anything. Any ideas?
更新:我从arango收到的实际错误是找不到光标"
UPDATE: the actual error I receive from arango is "cursor not found"
推荐答案
你们所有人都是正确的.但我认为这是2.3中的错误:
All of you are right. But I think it is a bug in 2.3:
--- a/arangod/V8Server/v8-vocbase.cpp
+++ b/arangod/V8Server/v8-vocbase.cpp
@@ -1216,13 +1216,13 @@ static v8::Handle<v8::Value> JS_ExecuteAql (v8::Arguments const& argv) {
optionName = v8::String::New("ttl");
if (argValue->Has(optionName)) {
- ttl = TRI_ObjectToBoolean(argValue->Get(optionName));
+ ttl = TRI_ObjectToDouble(argValue->Get(optionName));
ttl = (ttl <= 0.0 ? 30.0 : ttl);
}
ttl 是双精度型,因此应将其强制转换为双精度型,而不是布尔型. 不幸的是,将布尔值分配给double值在C ++中有效,因此编译器没有抱怨.
ttl is a double and so it should be casted to a double, not a bool. Unfortunately, assigning a bool to a double is valid in C++ so the compiler hasn't complained.
这篇关于ArangoDB游标超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!