MCPcopy Create free account
hub / github.com/TheSmallHanCat/flow2api / _cleanup_loop

Method _cleanup_loop

src/services/file_cache.py:207–220  ·  view source on GitHub ↗

Background task to clean up expired files

(self)

Source from the content-addressed store, hash-verified

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"""

Callers 1

start_cleanup_taskMethod · 0.95

Calls 3

sleepMethod · 0.80
log_errorMethod · 0.80

Tested by

no test coverage detected