Skip to content

Commit

Permalink
clear cache
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusandra committed Jul 14, 2024
1 parent f3d5c81 commit a8ac763
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion backend/app/models/frame.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import json
import os
from datetime import timezone
from app import db, socketio
from app import db, socketio, redis
from typing import Optional
from sqlalchemy.dialects.sqlite import JSON

Expand Down Expand Up @@ -159,6 +159,9 @@ def delete_frame(frame_id: int):
from .metrics import Metrics
Metrics.query.filter_by(frame_id=frame_id).delete()

cache_key = f'frame:{frame.frame_host}:{frame.frame_port}:image'
redis.delete(cache_key)

db.session.delete(frame)
db.session.commit()
socketio.emit('delete_frame', {'id': frame_id})
Expand Down

0 comments on commit a8ac763

Please sign in to comment.