redisAsyncContext *redis;
guint64 learned;
gint id;
+ gboolean has_event;
};
/* Used to get statistics from redis */
struct redis_stat_runtime *rt = REDIS_RUNTIME (data);
redisAsyncContext *redis;
+ rt->has_event = FALSE;
/* Stop timeout */
if (event_get_base (&rt->timeout_event)) {
event_del (&rt->timeout_event);
struct redis_stat_runtime *rt = REDIS_RUNTIME (data);
redisAsyncContext *redis;
+ rt->has_event = FALSE;
/* Stop timeout */
if (event_get_base (&rt->timeout_event)) {
event_del (&rt->timeout_event);
}
}
- if (rt->redis) {
+ if (rt->has_event) {
rspamd_session_remove_event (task->s, rspamd_redis_fin, rt);
}
}
}
}
- if (rt->redis) {
+ if (rt->has_event) {
rspamd_session_remove_event (task->s, rspamd_redis_fin_learn, rt);
}
}
rspamd_session_add_event (task->s, rspamd_redis_fin, rt,
rspamd_redis_stat_quark ());
+ rt->has_event = TRUE;
if (event_get_base (&rt->timeout_event)) {
event_del (&rt->timeout_event);
if (ret == REDIS_OK) {
rspamd_session_add_event (task->s, rspamd_redis_fin_learn, rt,
rspamd_redis_stat_quark ());
+ rt->has_event = TRUE;
/* Set timeout */
if (event_get_base (&rt->timeout_event)) {
event_del (&rt->timeout_event);