]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Set loaded flag when we load map from cache 5386/head
authorVsevolod Stakhov <vsevolod@rspamd.com>
Mon, 24 Mar 2025 15:17:09 +0000 (15:17 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Mon, 24 Mar 2025 15:17:09 +0000 (15:17 +0000)
src/libserver/maps/map.c

index 7a8bcfb7ffa119b935305d73892ab80780529c45..76d639a69736b8cbf678ca1c910c5ea5fe1363e5 100644 (file)
@@ -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);