Skip to content

Cache Slack images in /tmp instead of ~/.cache - #2

Merged
odfalik merged 1 commit into
mainfrom
chore/image-cache-in-tmp
Jul 1, 2026
Merged

odfalik merged 1 commit into
mainfrom
chore/image-cache-in-tmp

Conversation

@odfalik

@odfalik odfalik commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Switches the image cache dir from ~/.cache/golem-slack-images to /tmp/golem-slack-images.

Rationale: the download is keyed on cache-miss (if not path.exists(): download), so if macOS prunes an old /tmp file, a later read simply re-pulls it — stale paths self-heal. That removes the only reason we were using a durable dir, and avoids unbounded growth without needing a retention policy. SLACK_IMAGE_CACHE_DIR override still honored.

Tested: annotation now emits path=/tmp/golem-slack-images/…, image downloads and reads back as a valid PNG.

Stale paths self-heal: the fetch is keyed on cache-miss, so if the OS
prunes a /tmp file, a later read just re-downloads it. No need for a
durable dir or a retention policy. Override still honored via
SLACK_IMAGE_CACHE_DIR.
@odfalik
odfalik merged commit 778b41c into main Jul 1, 2026
@odfalik
odfalik deleted the chore/image-cache-in-tmp branch July 1, 2026 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant