ArangoDB 游标超时 [英] ArangoDB Cursor Timeout

查看:25
本文介绍了ArangoDB 游标超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 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 是一个双精度型,所以它应该被转换为双精度型,而不是布尔型.不幸的是,将 bool 分配给 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆