MCPcopy Index your code
hub / github.com/FSoft-AI4Code/CodeWiki / cleanup_old_jobs

Method cleanup_old_jobs

codewiki/src/fe/routes.py:288–299  ·  view source on GitHub ↗

Clean up old job status entries.

(self)

Source from the content-addressed store, hash-verified

286 return job_id.replace('--', '/')
287
288 def cleanup_old_jobs(self):
289 """Clean up old job status entries."""
290 cutoff = datetime.now() - timedelta(hours=WebAppConfig.JOB_CLEANUP_HOURS)
291 all_jobs = self.background_worker.get_all_jobs()
292 expired_jobs = [
293 job_id for job_id, job in all_jobs.items()
294 if job.created_at < cutoff and job.status in ['completed', 'failed']
295 ]
296
297 for job_id in expired_jobs:
298 if job_id in self.background_worker.job_status:
299 del self.background_worker.job_status[job_id]

Callers 1

index_postMethod · 0.95

Calls 1

get_all_jobsMethod · 0.80

Tested by

no test coverage detected