diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-10-26 16:06:12 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-10-26 16:06:12 +0100 |
commit | 0c20729f33f07cdcef5f7c10bde04f262c4a4574 (patch) | |
tree | 66853c7d49a7e51715ce1bc73ab12998bc28c7a9 /src/libstat/learn_cache | |
parent | 2ae394086bb5385ae4bc216cf694fe35692522a3 (diff) | |
download | rspamd-0c20729f33f07cdcef5f7c10bde04f262c4a4574.tar.gz rspamd-0c20729f33f07cdcef5f7c10bde04f262c4a4574.zip |
[Rework] Add more traces to async events, get rid of GQuarks
Diffstat (limited to 'src/libstat/learn_cache')
-rw-r--r-- | src/libstat/learn_cache/redis_cache.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/libstat/learn_cache/redis_cache.c b/src/libstat/learn_cache/redis_cache.c index 789991186..2fbf8bc4e 100644 --- a/src/libstat/learn_cache/redis_cache.c +++ b/src/libstat/learn_cache/redis_cache.c @@ -28,6 +28,8 @@ #define REDIS_DEFAULT_PORT 6379 #define DEFAULT_REDIS_KEY "learned_ids" +static const gchar *M = "redis learn cache"; + struct rspamd_redis_cache_ctx { struct rspamd_statfile_config *stcf; struct upstream_list *read_servers; @@ -51,7 +53,7 @@ struct rspamd_redis_cache_runtime { static GQuark rspamd_stat_cache_redis_quark (void) { - return g_quark_from_static_string ("redis-statistics"); + return g_quark_from_static_string (M); } static void @@ -153,7 +155,7 @@ rspamd_stat_cache_redis_get (redisAsyncContext *c, gpointer r, gpointer priv) if (rt->has_event) { if (rt->item) { - rspamd_symcache_item_async_dec_check (task, rt->item); + rspamd_symcache_item_async_dec_check (task, rt->item, M); } rspamd_session_remove_event (task->s, rspamd_redis_cache_fin, rt); } @@ -178,7 +180,7 @@ rspamd_stat_cache_redis_set (redisAsyncContext *c, gpointer r, gpointer priv) if (rt->has_event) { if (rt->item) { - rspamd_symcache_item_async_dec_check (task, rt->item); + rspamd_symcache_item_async_dec_check (task, rt->item, M); } rspamd_session_remove_event (task->s, rspamd_redis_cache_fin, rt); } @@ -463,7 +465,7 @@ rspamd_stat_cache_redis_check (struct rspamd_task *task, rspamd_session_add_event (task->s, rspamd_redis_cache_fin, rt, - rspamd_stat_cache_redis_quark ()); + M); rt->item = rspamd_symbols_cache_get_cur_item (task); event_add (&rt->timeout_event, &tv); rt->has_event = TRUE; @@ -497,7 +499,7 @@ rspamd_stat_cache_redis_learn (struct rspamd_task *task, "HSET %s %s %d", rt->ctx->redis_object, h, flag) == REDIS_OK) { rspamd_session_add_event (task->s, - rspamd_redis_cache_fin, rt, rspamd_stat_cache_redis_quark ()); + rspamd_redis_cache_fin, rt, M); rt->item = rspamd_symbols_cache_get_cur_item (task); event_add (&rt->timeout_event, &tv); rt->has_event = TRUE; |