Skip to content

Commit

Permalink
lib-index: Write forced cache decision changes immediately to cache file
Browse files Browse the repository at this point in the history
When mail_always/never_cache_fields doesn't match the current caching
decisions in the cache file, write the updated decisions to the file.
  • Loading branch information
sirainen committed Jan 24, 2018
1 parent 8841d0b commit 0ee986f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib-index/mail-cache-fields.c
Expand Up @@ -405,7 +405,10 @@ int mail_cache_header_fields_read(struct mail_cache *cache)
enum mail_cache_decision_type cur_dec =
cache->fields[fidx].field.decision;
if ((cur_dec & MAIL_CACHE_DECISION_FORCED) != 0) {
/* Forced decision. */
/* Forced decision. If the decision has
changed, update the fields in the file. */
if ((cur_dec & ~MAIL_CACHE_DECISION_FORCED) != file_dec)
cache->field_header_write_pending = TRUE;
} else if (cache->fields[fidx].decision_dirty) {
/* Decisions have recently been updated
internally. Don't change them. */
Expand Down

0 comments on commit 0ee986f

Please sign in to comment.