aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2025-03-24 15:17:09 +0000
committerVsevolod Stakhov <vsevolod@rspamd.com>2025-03-24 15:17:09 +0000
commit8b11af83c64ad0c7c9bf19e58c2ce6f0e059fb28 (patch)
tree68475ddc78cc9f2adcbf9c7a762970a67e3847da /src
parent91e8bbf79897f13072302216ce2ca516785d31f5 (diff)
downloadrspamd-vstakhov-maps-stuff.tar.gz
rspamd-vstakhov-maps-stuff.zip
[Minor] Set loaded flag when we load map from cachevstakhov-maps-stuff
Diffstat (limited to 'src')
-rw-r--r--src/libserver/maps/map.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libserver/maps/map.c b/src/libserver/maps/map.c
index 7a8bcfb7f..76d639a69 100644
--- a/src/libserver/maps/map.c
+++ b/src/libserver/maps/map.c
@@ -426,6 +426,7 @@ http_map_finish(struct rspamd_http_connection *conn,
*/
g_atomic_int_set(&data->cache->available, 1);
g_atomic_int_set(&map->shared->loaded, 1);
+ g_atomic_int_set(&map->shared->cached, 0);
/* Store cached data */
rspamd_strlcpy(data->cache->shmem_name, cbd->shmem_data->shm_name,
sizeof(data->cache->shmem_name));
@@ -1735,6 +1736,8 @@ rspamd_map_read_http_cached_file(struct rspamd_map *map,
struct tm tm;
char ncheck_buf[32], lm_buf[32];
+ g_atomic_int_set(&map->shared->loaded, 1);
+ g_atomic_int_set(&map->shared->cached, 1);
rspamd_localtime(map->next_check, &tm);
strftime(ncheck_buf, sizeof(ncheck_buf) - 1, "%Y-%m-%d %H:%M:%S", &tm);
rspamd_localtime(htdata->last_modified, &tm);