return;
}
+ if (!(how & RSPAMD_MAP_SCHEDULE_INIT) && map->static_only) {
+ /* No need to schedule anything for static maps */
+ return;
+ }
+
if (map->non_trivial && map->next_check != 0) {
timeout = map->next_check - rspamd_get_calendar_ticks ();
map = cbd->map;
map->scheduled_check = NULL;
- if (!cbd->locked) {
+ if (!map->file_only && !cbd->locked) {
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, "
}
}
+ map->file_only = TRUE;
+ map->static_only = TRUE;
+
PTR_ARRAY_FOREACH (map->backends, i, bk) {
bk->event_loop = event_loop;
data->filename, map->poll_timeout * cfg->map_file_watch_multiplier);
data->st_ev.data = map;
ev_stat_start (event_loop, &data->st_ev);
+ map->static_only = FALSE;
}
else if ((bk->protocol == MAP_PROTO_HTTP ||
- bk->protocol == MAP_PROTO_HTTPS) && map->active_http) {
- map->non_trivial = TRUE;
+ bk->protocol == MAP_PROTO_HTTPS)) {
+ if (map->active_http) {
+ map->non_trivial = TRUE;
+ }
+
+ map->static_only = FALSE;
+ map->file_only = FALSE;
}
}
time_t next_check;
gboolean active_http;
gboolean non_trivial; /* E.g. has http backends in active mode */
+ gboolean file_only; /* No HTTP backends found */
+ gboolean static_only; /* No need to check */
/* Shared lock for temporary disabling of map reading (e.g. when this map is written by UI) */
gint *locked;
gchar tag[MEMPOOL_UID_LEN];