We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bool setCounter(void *c, const char *faceset_id) { acl::redis_client_pool *pool = (acl::redis_client_pool *)c; acl::redis_client *conn; conn = (acl::redis_client *)pool->peek();
if (conn == NULL) { printf("GET redis failed: %s\n", faceset_id); return 0; } acl::redis_string counter; counter.set_client(conn); acl::string key; key.format("faceset_rows_%s", faceset_id); if (counter.incrby(key.c_str(), 1, NULL) != true) { printf("Set counter failure. Reason: %s, key: %s\n", counter.result_error(), key.c_str()); return false; } counter.clear(); return true;
} 这段代码是正常的。
但是如果对于一个不熟悉、或者不了解acl::redis的用户来说,直接使用下面这块代码(缺少从连接池申请链接),incrby函数执行失败,但是conter.result_error()输出的错误信息却是空的。这点让人很是抓狂的,希望能够完善。 acl::redis_string counter; acl::string key; key.format("faceset_rows_%s", faceset_id); if (counter.incrby(key.c_str(), 1, NULL) != true) { printf("Set counter failure. Reason: %s, key: %s\n", counter.result_error(), key.c_str()); return false; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
bool setCounter(void *c, const char *faceset_id)
{
acl::redis_client_pool *pool = (acl::redis_client_pool *)c;
acl::redis_client *conn;
conn = (acl::redis_client *)pool->peek();
}
这段代码是正常的。
但是如果对于一个不熟悉、或者不了解acl::redis的用户来说,直接使用下面这块代码(缺少从连接池申请链接),incrby函数执行失败,但是conter.result_error()输出的错误信息却是空的。这点让人很是抓狂的,希望能够完善。
acl::redis_string counter;
acl::string key;
key.format("faceset_rows_%s", faceset_id);
if (counter.incrby(key.c_str(), 1, NULL) != true)
{
printf("Set counter failure. Reason: %s, key: %s\n", counter.result_error(), key.c_str());
return false;
}
The text was updated successfully, but these errors were encountered: