Skip to content

Commit

Permalink
Also catch invalid refresh in ledger race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
stephen-riggs committed Nov 27, 2023
1 parent 74f30b9 commit 7c7cb44
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/murfey/server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
)
from rich.logging import RichHandler
from sqlalchemy import func
from sqlalchemy.exc import PendingRollbackError, SQLAlchemyError
from sqlalchemy.exc import InvalidRequestError, PendingRollbackError, SQLAlchemyError
from sqlalchemy.orm.exc import ObjectDeletedError
from sqlmodel import Session, create_engine, select

Expand Down Expand Up @@ -405,7 +405,7 @@ def _murfey_id(app_id: int, _db, number: int = 1, close: bool = True) -> List[in
_db.refresh(m)
res = [m.id for m in murfey_ledger if m.id is not None]
break
except ObjectDeletedError:
except (ObjectDeletedError, InvalidRequestError):
pass
attempts += 1
time.sleep(0.1)
Expand Down

0 comments on commit 7c7cb44

Please sign in to comment.