summaryrefslogtreecommitdiffstats
path: root/src/libstat
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-08-29 13:06:23 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-08-29 13:06:23 +0100
commitb3713de7cefa87af9ed95d091db497cef63502d0 (patch)
treed689606317be5f22ede887fc7ae418247a3bef60 /src/libstat
parent30c0dca001842d9dc009be0ff9ade49b69963bd2 (diff)
downloadrspamd-b3713de7cefa87af9ed95d091db497cef63502d0.tar.gz
rspamd-b3713de7cefa87af9ed95d091db497cef63502d0.zip
[Fix] Fix pending checks for events
Diffstat (limited to 'src/libstat')
-rw-r--r--src/libstat/backends/redis_backend.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libstat/backends/redis_backend.c b/src/libstat/backends/redis_backend.c
index 9dd3624fb..fd31d287a 100644
--- a/src/libstat/backends/redis_backend.c
+++ b/src/libstat/backends/redis_backend.c
@@ -1021,7 +1021,7 @@ rspamd_redis_fin (gpointer data)
rt->has_event = FALSE;
/* Stop timeout */
- if (ev_is_active (&rt->timeout_event)) {
+ if (ev_can_stop (&rt->timeout_event)) {
ev_timer_stop (rt->task->event_loop, &rt->timeout_event);
}
@@ -1280,7 +1280,7 @@ rspamd_redis_connected (redisAsyncContext *c, gpointer r, gpointer priv)
/* Further is handled by rspamd_redis_processed */
final = FALSE;
/* Restart timeout */
- if (ev_is_active (&rt->timeout_event)) {
+ if (ev_can_stop (&rt->timeout_event)) {
rt->timeout_event.repeat = rt->ctx->timeout;
ev_timer_again (task->event_loop, &rt->timeout_event);
}
@@ -1684,7 +1684,7 @@ rspamd_redis_process_tokens (struct rspamd_task *task,
rt->has_event = TRUE;
rt->tokens = g_ptr_array_ref (tokens);
- if (ev_is_active (&rt->timeout_event)) {
+ if (ev_can_stop (&rt->timeout_event)) {
rt->timeout_event.repeat = rt->ctx->timeout;
ev_timer_again (task->event_loop, &rt->timeout_event);
}
@@ -1706,7 +1706,7 @@ rspamd_redis_finalize_process (struct rspamd_task *task, gpointer runtime,
struct redis_stat_runtime *rt = REDIS_RUNTIME (runtime);
redisAsyncContext *redis;
- if (ev_is_active (&rt->timeout_event)) {
+ if (ev_can_stop (&rt->timeout_event)) {
ev_timer_stop (task->event_loop, &rt->timeout_event);
}
@@ -1889,7 +1889,7 @@ rspamd_redis_learn_tokens (struct rspamd_task *task, GPtrArray *tokens,
rt->has_event = TRUE;
/* Set timeout */
- if (ev_is_active (&rt->timeout_event)) {
+ if (ev_can_stop (&rt->timeout_event)) {
rt->timeout_event.repeat = rt->ctx->timeout;
ev_timer_again (task->event_loop, &rt->timeout_event);
}
@@ -1917,7 +1917,7 @@ rspamd_redis_finalize_learn (struct rspamd_task *task, gpointer runtime,
struct redis_stat_runtime *rt = REDIS_RUNTIME (runtime);
redisAsyncContext *redis;
- if (ev_is_active (&rt->timeout_event)) {
+ if (ev_can_stop (&rt->timeout_event)) {
ev_timer_stop (task->event_loop, &rt->timeout_event);
}