fix cleanup old media files and add some gitignore #313
+67
−4
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.
🗑️ Add Automatic File Cleanup for Generative Miners
Problem
Generative miners save generated images, videos, and JSON metadata files to disk temporarily, but these files were never deleted. This caused storage to fill up over time.
Solution
Added automatic cleanup functionality to the existing cleanup thread that removes old files from the output directory.
Changes Made
1. Enhanced Cleanup Thread (neurons/generator/miner.py)
.png,.mp4,.json,.jpg,.jpeg,.gif,.webm,.avi2. Configuration (gas/config.py)
--miner.file-max-age-hoursparameter (default: 1.0 hour)--miner.cleanup-intervalfor cleanup frequency (default: 3600 seconds)Behavior
Default Settings:
🗑️ Deleted 12 old files from disk (older than 1.0h)Configuration Example:
Note: I also added some gitignore so please check it as well.
Contribution by Gittensor, learn more at https://gittensor.io