]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: Update last_used field immediately when adding a new cache field
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Sun, 5 Apr 2020 17:41:28 +0000 (20:41 +0300)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 15 Apr 2020 09:41:43 +0000 (12:41 +0300)
Otherwise the newly added field could be dropped immediately on the next
purge.

src/lib-index/mail-cache-decisions.c

index 904268eb35802b52faec12548c7fb8cabb90ad42..a39ad8ef4848cab3df60f8abfa9220e08ba43fb0 100644 (file)
@@ -145,6 +145,7 @@ void mail_cache_decision_add(struct mail_cache_view *view, uint32_t seq,
 
        /* field used the first time */
        cache->fields[field].field.decision = MAIL_CACHE_DECISION_TEMP;
+       cache->fields[field].field.last_used = ioloop_time;
        cache->fields[field].decision_dirty = TRUE;
        cache->field_header_write_pending = TRUE;