gdouble timeout;
struct map_periodic_cbdata *cbd;
- if (map->scheduled_check || (map->wrk && map->wrk->state == rspamd_worker_state_running)) {
- /* Do not schedule check if some check is already scheduled */
+ if (map->scheduled_check || (map->wrk &&
+ map->wrk->state != rspamd_worker_state_running)) {
+ /*
+ * Do not schedule check if some check is already scheduled or
+ * if worker is going to die
+ */
return;
}
map->scheduled_check = NULL;
if (!map->file_only && !cbd->locked) {
- if (!g_atomic_int_compare_and_exchange (cbd->map->locked, 0, 1)) {
+ if (!g_atomic_int_compare_and_exchange (cbd->map->locked,
+ 0, 1)) {
msg_debug_map (
"don't try to reread map %s as it is locked by other process, "
"will reread it later", cbd->map->name);
return;
}
- if (!(cbd->map->wrk && cbd->map->wrk->state == rspamd_worker_state_running)) {
+ if (cbd->map->wrk && cbd->map->wrk->state == rspamd_worker_state_running) {
bk = g_ptr_array_index (cbd->map->backends, cbd->cur_backend);
g_assert (bk != NULL);
Check Rspamc ${result} MAP_SET_HIT_AND_MISS (1.00)[example.com]
WRITE NEW MAP
- Sleep 1s Wait for new time
${TMP_FILE} = Make Temporary File
Copy File ${TESTDIR}/configs/maps/domains.list.2 ${TMP_FILE}
Move File ${TMP_FILE} ${MAP_FILE}