aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/libstat/backends/redis_backend.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/src/libstat/backends/redis_backend.c b/src/libstat/backends/redis_backend.c
index 121162fc8..68da6bc89 100644
--- a/src/libstat/backends/redis_backend.c
+++ b/src/libstat/backends/redis_backend.c
@@ -745,7 +745,7 @@ rspamd_redis_stat_learns (redisAsyncContext *c, gpointer r, gpointer priv)
rspamd_strtoul (reply->str, reply->len, &num);
}
- obj = (ucl_object_t *)ucl_object_lookup (cbdata->cur, "revision");
+ obj = (ucl_object_t *) ucl_object_lookup (cbdata->cur, "revision");
if (obj) {
obj->value.iv += num;
}
@@ -852,17 +852,26 @@ rspamd_redis_stat_keys (redisAsyncContext *c, gpointer r, gpointer priv)
else {
learned_key = "learns_ham";
}
+ redisAsyncCommand (cbdata->redis,
+ rspamd_redis_stat_learns,
+ cbdata,
+ "HGET %s %s",
+ k, learned_key);
+ cbdata->inflight += 1;
+ }
+ else {
+ redisAsyncCommand (cbdata->redis,
+ rspamd_redis_stat_key,
+ cbdata,
+ "HLEN %s",
+ k);
+ redisAsyncCommand (cbdata->redis,
+ rspamd_redis_stat_learns,
+ cbdata,
+ "HGET %s %s",
+ k, learned_key);
+ cbdata->inflight += 2;
}
-
- redisAsyncCommand (cbdata->redis, rspamd_redis_stat_key,
- cbdata,
- "HLEN %s",
- k);
- redisAsyncCommand (cbdata->redis, rspamd_redis_stat_learns,
- cbdata,
- "HGET %s %s",
- k, learned_key);
- cbdata->inflight += 2;
}
}
}