Skip to content

Commit

Permalink
fix(db): don't throw error if attempting to delete an entry that does…
Browse files Browse the repository at this point in the history
… not exits
  • Loading branch information
a1ex4 committed Dec 17, 2024
1 parent ecaf409 commit 6c4c574
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ def delete_file_by_filepath(filepath):
db.session.commit()

logger.info(f"File '{filepath}' has been deleted.")
except NoResultFound:
logger.info(f"File '{filepath}' not present in database.")
except Exception as e:
# If there's an error, rollback the session
db.session.rollback()
Expand Down

0 comments on commit 6c4c574

Please sign in to comment.