compile_id,group_id,item_id support uint64_t
This commit is contained in:
@@ -352,4 +352,26 @@ error_out:
|
||||
FREE(s_rule);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
long long maat_cmd_incrby(struct maat *maat_instance, const char *key, int increment)
|
||||
{
|
||||
long long result = 0;
|
||||
|
||||
redisContext *write_ctx = get_redis_ctx_for_write(maat_instance);
|
||||
if (NULL == write_ctx) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
redisReply *data_reply = maat_cmd_wrap_redis_command(write_ctx, "INCRBY %s %d", key, increment);
|
||||
if (data_reply->type == REDIS_REPLY_INTEGER) {
|
||||
result = data_reply->integer;
|
||||
} else {
|
||||
result = -1;
|
||||
}
|
||||
|
||||
freeReplyObject(data_reply);
|
||||
data_reply = NULL;
|
||||
|
||||
return result;
|
||||
}
|
||||
Reference in New Issue
Block a user