Delete expired attachments based on mod time instead of DB entry to avoid races

This commit is contained in:
Philipp Heckel 2022-07-08 10:00:04 -04:00
parent 3e53d8a2c7
commit 10a9aca2a1
6 changed files with 65 additions and 43 deletions

View file

@ -344,10 +344,6 @@ func testCacheAttachments(t *testing.T, c *messageCache) {
size, err = c.AttachmentBytesUsed("5.6.7.8")
require.Nil(t, err)
require.Equal(t, int64(0), size)
ids, err := c.AttachmentsExpired()
require.Nil(t, err)
require.Equal(t, []string{"m1"}, ids)
}
func TestSqliteCache_Migration_From0(t *testing.T) {