diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-10-06 13:35:14 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-10-06 13:35:14 +0100 |
commit | 915a460b6a425cc5694f4166c86ee8138ffd0ace (patch) | |
tree | 9bb4d5be1cdbc13522241a1035367ab58298b001 /src/libstat/backends/redis_backend.c | |
parent | 619fdbc7b82eea8f7b4f38fa9f29c02802619727 (diff) | |
download | rspamd-915a460b6a425cc5694f4166c86ee8138ffd0ace.tar.gz rspamd-915a460b6a425cc5694f4166c86ee8138ffd0ace.zip |
[Minor] Fix event pending checks
Diffstat (limited to 'src/libstat/backends/redis_backend.c')
-rw-r--r-- | src/libstat/backends/redis_backend.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libstat/backends/redis_backend.c b/src/libstat/backends/redis_backend.c index 35930c923..74d8c3bf1 100644 --- a/src/libstat/backends/redis_backend.c +++ b/src/libstat/backends/redis_backend.c @@ -994,7 +994,7 @@ rspamd_redis_fin (gpointer data) rt->has_event = FALSE; /* Stop timeout */ - if (event_get_base (&rt->timeout_event)) { + if (rspamd_event_pending (&rt->timeout_event, EV_TIMEOUT)) { event_del (&rt->timeout_event); } @@ -1014,7 +1014,7 @@ rspamd_redis_fin_learn (gpointer data) rt->has_event = FALSE; /* Stop timeout */ - if (event_get_base (&rt->timeout_event)) { + if (rspamd_event_pending (&rt->timeout_event, EV_TIMEOUT)) { event_del (&rt->timeout_event); } @@ -1597,7 +1597,7 @@ rspamd_redis_process_tokens (struct rspamd_task *task, rspamd_session_add_event (task->s, NULL, rspamd_redis_fin, rt, rspamd_redis_stat_quark ()); rt->has_event = TRUE; - if (event_get_base (&rt->timeout_event)) { + if (rspamd_event_pending (&rt->timeout_event, EV_TIMEOUT)) { event_del (&rt->timeout_event); } event_set (&rt->timeout_event, -1, EV_TIMEOUT, rspamd_redis_timeout, rt); @@ -1634,7 +1634,7 @@ rspamd_redis_finalize_process (struct rspamd_task *task, gpointer runtime, struct redis_stat_runtime *rt = REDIS_RUNTIME (runtime); redisAsyncContext *redis; - if (event_get_base (&rt->timeout_event)) { + if (rspamd_event_pending (&rt->timeout_event, EV_TIMEOUT)) { event_del (&rt->timeout_event); } @@ -1802,7 +1802,7 @@ rspamd_redis_learn_tokens (struct rspamd_task *task, GPtrArray *tokens, rt->has_event = TRUE; /* Set timeout */ - if (event_get_base (&rt->timeout_event)) { + if (rspamd_event_pending (&rt->timeout_event, EV_TIMEOUT)) { event_del (&rt->timeout_event); } event_set (&rt->timeout_event, -1, EV_TIMEOUT, rspamd_redis_timeout, rt); @@ -1827,7 +1827,7 @@ rspamd_redis_finalize_learn (struct rspamd_task *task, gpointer runtime, struct redis_stat_runtime *rt = REDIS_RUNTIME (runtime); redisAsyncContext *redis; - if (event_get_base (&rt->timeout_event)) { + if (rspamd_event_pending (&rt->timeout_event, EV_TIMEOUT)) { event_del (&rt->timeout_event); } |