X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fwrite_redis.c;h=2a6f9124aee0f9a66e3c6a004d8456442d7a067b;hb=26314b8c3fb08e1f0017ee9a6277b7fe370bf2a0;hp=02663c6609c0d5f1923bb5192e718927782eaaa5;hpb=cf33da9ad00ac94931a2c87563f8d007a996f1ad;p=collectd.git diff --git a/src/write_redis.c b/src/write_redis.c index 02663c66..2a6f9124 100644 --- a/src/write_redis.c +++ b/src/write_redis.c @@ -134,12 +134,19 @@ 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 collectd/values %s", ident); if (rr==NULL) WARNING("SADD command error. ident:%s message:%s", ident, node->conn->errstr); + else + freeReplyObject (rr); pthread_mutex_unlock (&node->lock);