fix(media): add periodic cleanup for all media files#24519
Closed
heyhudson wants to merge 1 commit intoopenclaw:mainfrom
Closed
fix(media): add periodic cleanup for all media files#24519heyhudson wants to merge 1 commit intoopenclaw:mainfrom
heyhudson wants to merge 1 commit intoopenclaw:mainfrom
Conversation
46e277b to
4f6dfa9
Compare
16f1e96 to
c63cc62
Compare
Contributor
Greptile SummaryAdded periodic media cleanup timer that runs hourly to remove old files from Key changes:
Implementation notes:
Confidence Score: 5/5
Last reviewed commit: c63cc62 |
c63cc62 to
6950d93
Compare
6950d93 to
4a436fe
Compare
4a436fe to
1aad4d8
Compare
Member
|
Picked this up in #38292 so the final media fix can land as one scoped PR. That branch carries forward the top-level Keeping this linked for contributor credit because the retention-config and gateway-lifecycle pieces came from here. |
Member
|
Resolved in #38292 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a gateway-lifecycle media cleanup timer that periodically removes old files from all
~/.openclaw/media/subdirectories based on a configurable TTL. Default retention window is 24 hours, configurable viamedia.ttlHours.What Changed
src/gateway/server-maintenance.ts:startGatewayMaintenanceTimers()now schedules media cleanup hourly and runs one startup pass.src/gateway/server.impl.ts: Computes the cleanup TTL fromconfig.media.ttlHours(default: 24 hours) and passes it to maintenance timers.src/gateway/server-close.ts: Clears the new media cleanup interval during shutdown.src/media/store.ts: Whitespace-only change (blank line added).src/config/types.openclaw.ts: Addedmedia.ttlHoursconfig type.src/config/zod-schema.ts: Added Zod schema formedia.ttlHours.src/config/schema.help.ts: Added help text formedia.ttlHours.src/config/schema.labels.ts: Added label formedia.ttlHours.Testing
src/gateway/server-maintenance.test.ts(new): Verifies the media cleanup timer callscleanOldMedia(ttlMs)on schedule.src/media/store.test.ts: Verifies cleanup removes old files across media subdirectories.AI Disclosure