aboutsummaryrefslogtreecommitdiffstats
path: root/cloud_mdir_sync/maildir.py
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@mellanox.com>2020-05-30 20:32:19 -0300
committerJason Gunthorpe <jgg@mellanox.com>2020-05-30 20:32:19 -0300
commitd01fb937615bc4bc91cac8aa543bcc7e8476f870 (patch)
treec4304c8c93d926f1a32cd226f60add4a99f9ee71 /cloud_mdir_sync/maildir.py
parentd695a2eadde2d0799b5c663690212ec022d61c1c (diff)
downloadcloud_mdir_sync-d01fb937615bc4bc91cac8aa543bcc7e8476f870.tar.gz
cloud_mdir_sync-d01fb937615bc4bc91cac8aa543bcc7e8476f870.tar.bz2
cloud_mdir_sync-d01fb937615bc4bc91cac8aa543bcc7e8476f870.zip
Keep the inode cache in sync when writing to the MailDir
MailDir writes cause the inode mtime and ctime to change which causes the cache to become invalid. Update the mtime and ctime information after changing it. Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'cloud_mdir_sync/maildir.py')
-rw-r--r--cloud_mdir_sync/maildir.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/cloud_mdir_sync/maildir.py b/cloud_mdir_sync/maildir.py
index c7f1be5..51497be 100644
--- a/cloud_mdir_sync/maildir.py
+++ b/cloud_mdir_sync/maildir.py
@@ -149,6 +149,7 @@ class MailDirMailbox(mailbox.Mailbox):
# delivered it.
if cloudmsg.received_time is not None:
os.utime(fn, (time.time(), cloudmsg.received_time.timestamp()))
+ self.msgdb.update_inode_cache(msg)
self.messages[msg.content_hash] = msg
def _set_flags(self, mymsg: messages.Message, cloudmsg: messages.Message):