/* Not modified */
}
- rspamd_map_schedule_periodic (periodic->map, FALSE, FALSE, FALSE);
-
if (periodic->locked) {
+ rspamd_map_schedule_periodic (periodic->map, FALSE, FALSE, FALSE);
g_atomic_int_set (periodic->map->locked, 0);
}
timeout = map->poll_timeout * error_mult;
}
else if (locked) {
- timeout = map->poll_timeout * lock_mult;
+ timeout = lock_mult;
}
cbd = g_slice_alloc0 (sizeof (*cbd));
cbd->map = map;
REF_INIT_RETAIN (cbd, rspamd_map_periodic_dtor);
- msg_debug_map ("schedule new periodic event %p in %.2f seconds", cbd, timeout);
-
if (initial) {
evtimer_set (&map->ev, rspamd_map_periodic_callback, cbd);
event_base_set (map->ev_base, &map->ev);
else {
evtimer_del (&map->ev);
evtimer_set (&map->ev, rspamd_map_periodic_callback, cbd);
+ event_base_set (map->ev_base, &map->ev);
}
jittered_sec = rspamd_time_jitter (timeout, 0);
+ msg_debug_map ("schedule new periodic event %p in %.2f seconds", cbd, jittered_sec);
double_to_tv (jittered_sec, &map->tv);
evtimer_add (&map->ev, &map->tv);