X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fwrite_redis.c;h=fa58ad2ace61667322f606a08b380bdb63b7b188;hb=9bd400b6073c7ad4e3ba4b6f568fd7f608a4b02f;hp=909f51d51aa23ff396da9c259430618efd45043b;hpb=88f22ff8b4c69eb38b6aaab30df212df1871d4ec;p=collectd.git diff --git a/src/write_redis.c b/src/write_redis.c index 909f51d5..fa58ad2a 100644 --- a/src/write_redis.c +++ b/src/write_redis.c @@ -141,14 +141,21 @@ static int wr_write (const data_set_t *ds, /* {{{ */ } rr = redisCommand (node->conn, "ZADD %s %s %s", key, time, value); - if (rr==NULL) + if (rr == NULL) WARNING("ZADD command error. key:%s message:%s", key, node->conn->errstr); + else + freeReplyObject (rr); + /* TODO(octo): This is more overhead than necessary. Use the cache and + * metadata to determine if it is a new metric and call SADD only once for + * each metric. */ rr = redisCommand (node->conn, "SADD %svalues %s", (node->prefix != NULL) ? node->prefix : REDIS_DEFAULT_PREFIX, ident); if (rr==NULL) WARNING("SADD command error. ident:%s message:%s", ident, node->conn->errstr); + else + freeReplyObject (rr); pthread_mutex_unlock (&node->lock);