This commit is contained in:
binwiederhier 2026-03-21 17:03:29 -04:00
parent 78d3138565
commit b3a8f18019
2 changed files with 6 additions and 1 deletions

View file

@ -162,7 +162,7 @@ func (c *Store) sync() error {
sizes[obj.ID] = obj.Size
}
}
log.Tag(tagStore).Debug("Attachment cache size updated to %s", util.FormatSizeHuman(size))
log.Tag(tagStore).Debug("Attachment store updated: %d attachment(s), %s", len(localIDs), util.FormatSizeHuman(size))
c.mu.Lock()
c.size = size
c.sizes = sizes

View file

@ -547,6 +547,11 @@ When `endpoint` is specified, path-style addressing is enabled automatically (us
attachment-cache-dir: "s3://AKID:SECRET@my-bucket/attachments?region=us-east-1&endpoint=https://s3.example.com"
```
**Cleanup behavior:** A background sync runs every 15 minutes to reconcile the S3 bucket (or configured prefix) with
the server's message database. Objects whose keys match attachment file IDs that are no longer referenced in the database
(and are older than 1 hour) are automatically deleted. This also cleans up incomplete S3 multipart uploads that were
abandoned due to interrupted or failed attachment uploads.
Please also refer to the [rate limiting](#rate-limiting) settings below, specifically `visitor-attachment-total-size-limit`
and `visitor-attachment-daily-bandwidth-limit`. Setting these conservatively is necessary to avoid abuse.