File tree Expand file tree Collapse file tree
simplified-books-controller/src/main/java/org/nypl/simplified/books/controller Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -127,11 +127,16 @@ class BookSyncTask(
127127 try {
128128 this .logger.debug(" [{}] checking for deletion" , existingId.brief())
129129 val dbEntry = bookDatabase.entry(existingId)
130- val avail = dbEntry.book.entry.availability
131- val endDate = avail.endDate.getOrNull() ? : continue
132130
133- if (endDate <= DateTime .now()) {
134- this .logger.debug(" [{}] deleting" , existingId.brief())
131+ // Only expire Axis books
132+ val dist = dbEntry.book.entry.distribution
133+ if (dist != " Axis 360" ) continue
134+ this .logger.debug(" [{}] is Axis pub, checking expiration" , existingId.brief())
135+
136+ val avail = dbEntry.book.entry.availability
137+ val endDate = avail.endDate.getOrNull()
138+ if (endDate == null || endDate <= DateTime .now()) {
139+ this .logger.debug(" [{}] is expired, deleting" , existingId.brief())
135140 bookRegistry.clearFor(existingId)
136141 dbEntry.delete()
137142 }
You can’t perform that action at this time.
0 commit comments