Skip to content

Commit

Permalink
[PP-2065] Address library not persistent within session errors by ens…
Browse files Browse the repository at this point in the history
…uring the (#2246)

library and other objects accessed within the new transaction are attached to the session.
  • Loading branch information
dbernstein committed Jan 14, 2025
1 parent b20f0d9 commit b517e6f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/palace/manager/celery/tasks/opds_odl.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,14 +218,14 @@ def collect_events(
"""
with task.session() as session:
for e in events:
session.refresh(e.library)
session.refresh(e.license_pool)
session.refresh(e.patron)
library = session.merge(e.library)
license_pool = session.merge(e.license_pool)
patron = session.merge(e.patron)
analytics.collect_event(
event_type=e.event_type,
library=e.library,
license_pool=e.license_pool,
patron=e.patron,
library=library,
license_pool=license_pool,
patron=patron,
)


Expand Down

0 comments on commit b517e6f

Please sign in to comment.