Remove expired cache entries.
(self)
| 104 | self.save_cache_index() |
| 105 | |
| 106 | def cleanup_expired_cache(self): |
| 107 | """Remove expired cache entries.""" |
| 108 | expired_entries = [] |
| 109 | cutoff = datetime.now() - timedelta(days=self.cache_expiry_days) |
| 110 | |
| 111 | for repo_hash, entry in self.cache_index.items(): |
| 112 | if entry.created_at < cutoff: |
| 113 | expired_entries.append(repo_hash) |
| 114 | |
| 115 | for repo_hash in expired_entries: |
| 116 | del self.cache_index[repo_hash] |
| 117 | |
| 118 | if expired_entries: |
| 119 | self.save_cache_index() |
nothing calls this directly
no test coverage detected