Fix clear-data to actually delete run_cache entries
- discard_run now deletes from run_cache and pending_runs tables - Add delete_run_cache() and delete_pending_run() database functions - Previously clear-data only cleared Redis, leaving DB cache intact Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -482,8 +482,18 @@ class RunService:
|
||||
# Remove task_id mapping from Redis
|
||||
self.redis.delete(f"{self.task_key_prefix}{run_id}")
|
||||
|
||||
# Note: We don't delete from run_cache as that's a permanent record
|
||||
# of completed work. The content itself remains in cache.
|
||||
# Remove from run_cache database table
|
||||
try:
|
||||
await self.db.delete_run_cache(run_id)
|
||||
except Exception as e:
|
||||
import logging
|
||||
logging.getLogger(__name__).warning(f"Failed to delete run_cache for {run_id}: {e}")
|
||||
|
||||
# Remove pending run if exists
|
||||
try:
|
||||
await self.db.delete_pending_run(run_id)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
return True, None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user