Tests for fileCache
This commit is contained in:
parent
e7c19a2bad
commit
cefe276ce5
7 changed files with 101 additions and 25 deletions
|
@ -833,13 +833,15 @@ func (s *Server) updateStatsAndPrune() {
|
|||
}
|
||||
|
||||
// Delete expired attachments
|
||||
ids, err := s.cache.AttachmentsExpired()
|
||||
if err == nil {
|
||||
if err := s.fileCache.Remove(ids); err != nil {
|
||||
log.Printf("error while deleting attachments: %s", err.Error())
|
||||
if s.fileCache != nil {
|
||||
ids, err := s.cache.AttachmentsExpired()
|
||||
if err == nil {
|
||||
if err := s.fileCache.Remove(ids...); err != nil {
|
||||
log.Printf("error while deleting attachments: %s", err.Error())
|
||||
}
|
||||
} else {
|
||||
log.Printf("error retrieving expired attachments: %s", err.Error())
|
||||
}
|
||||
} else {
|
||||
log.Printf("error retrieving expired attachments: %s", err.Error())
|
||||
}
|
||||
|
||||
// Prune message cache
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue