We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7f703c2 commit 3839531Copy full SHA for 3839531
1 file changed
api/odl2.py
@@ -348,6 +348,7 @@ def run_once(self, progress: TimestampData) -> TimestampData:
348
.filter(
349
and_(
350
LicensePool.open_access == False,
351
+ LicensePool.collection_id == self.api.collection_id,
352
or_(
353
Loan.end
354
< now
@@ -364,8 +365,11 @@ def run_once(self, progress: TimestampData) -> TimestampData:
364
365
changed_pools = set()
366
total_deleted_loans = 0
367
for loan in expired_loans:
368
+ # Only a license can be checked in
369
+ if loan.license:
370
+ loan.license.checkin()
371
changed_pools.add(loan.license_pool)
- loan.license.checkin()
372
+ self.log.info(f"Deleting loan {loan} in pool {loan.license_pool}")
373
self._db.delete(loan)
374
total_deleted_loans += 1
375
0 commit comments