Background task to clean up expired files
(self)
| 205 | return await self.start_cleanup_task() |
| 206 | |
| 207 | async def _cleanup_loop(self): |
| 208 | """Background task to clean up expired files""" |
| 209 | while True: |
| 210 | try: |
| 211 | await asyncio.sleep(300) # Check every 5 minutes |
| 212 | await self._cleanup_expired_files() |
| 213 | except asyncio.CancelledError: |
| 214 | break |
| 215 | except Exception as e: |
| 216 | debug_logger.log_error( |
| 217 | error_message=f"Cleanup task error: {str(e)}", |
| 218 | status_code=0, |
| 219 | response_text="" |
| 220 | ) |
| 221 | |
| 222 | async def _cleanup_expired_files(self): |
| 223 | """Remove expired cache files""" |
no test coverage detected