Skip to content

Commit

Permalink
Merge branch '24.05.00' into 24.06.00
Browse files Browse the repository at this point in the history
  • Loading branch information
mdnoble73 committed May 13, 2024
2 parents 39915ac + 637c888 commit dbe77f7
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 11 deletions.
Binary file modified code/cloud_library_export/cloud_library_export.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ CloudLibraryAvailability loadAvailabilityForRecord(String cloudLibraryId) {
boolean callSucceeded = false;
CloudLibraryAvailability availability = new CloudLibraryAvailability();
String apiPath = "/cirrus/library/" + settings.getLibraryId() + "/item/summary/" + cloudLibraryId;
while (!callSucceeded && numTries < 3) {
while (numTries < 3) {
if (numTries > 0) {
try {
//Sleep a little bit to allow the server to calm down.
Expand Down Expand Up @@ -446,7 +446,10 @@ CloudLibraryAvailability loadAvailabilityForRecord(String cloudLibraryId) {
}
}
numTries++;
if (numTries == 3 && !callSucceeded) {
if (callSucceeded) {
break;
}
if (numTries == 3) {
logEntry.incErrors("Did not get a successful API response after 3 tries for " + settings.getBaseUrl() + apiPath);
break;
}
Expand All @@ -460,11 +463,11 @@ CloudLibraryAvailabilityType loadAvailabilityTypeForRecord(String cloudLibraryId
boolean callSucceeded = false;
CloudLibraryAvailabilityType availabilityType = new CloudLibraryAvailabilityType();
String apiPath = "/cirrus/library/" + settings.getLibraryId() + "/circulation/item/" + cloudLibraryId;
while (!callSucceeded && numTries < 3) {
while (numTries < 3) {
if (numTries > 0) {
try {
//Sleep a little bit to allow the server to calm down.
Thread.sleep(60000);
Thread.sleep(15000);
} catch (InterruptedException e) {
//Not a big deal if this gets interrupted
}
Expand All @@ -484,6 +487,8 @@ CloudLibraryAvailabilityType loadAvailabilityTypeForRecord(String cloudLibraryId
logger.info("Error getting availability type from " + apiPath + ": " + response.getResponseCode());
}
} else {
callSucceeded = true;

availabilityType.setRawResponse(response.getMessage());
CloudLibraryAvailabilityTypeHandler handler = new CloudLibraryAvailabilityTypeHandler(availabilityType);

Expand All @@ -497,7 +502,10 @@ CloudLibraryAvailabilityType loadAvailabilityTypeForRecord(String cloudLibraryId
}
}
numTries++;
if (numTries == 3 && !callSucceeded) {
if (callSucceeded) {
break;
}
if (numTries == 3) {
logEntry.incErrors("Did not get a successful API response after 3 tries for " + settings.getBaseUrl() + apiPath);
break;
}
Expand Down
Binary file modified code/reindexer/reindexer.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,14 @@ public FormatInfo getFormatInfoForItem(DataField itemField, BaseIndexingSettings

if (!foundFormatFromShelfLocation && !foundFormatFromSublocation && !foundFormatFromCollection && !foundFormatFromIType) {
String format = MarcUtil.getItemSubfieldData(profile.getFormatSubfield(), itemField, logEntry, logger);
String translatedFormat = profile.translateValue("format", format);
if (translatedFormat != null && !translatedFormat.isEmpty()) {
formatInfo.format = translatedFormat;
formatInfo.formatCategory = profile.translateValue("format_category", format);
if (profile.hasTranslation("format_boost", format)) {
formatBoost = profile.translateValue("format_boost", format);
if (format != null && profile.hasTranslation("format", format)) {
String translatedFormat = profile.translateValue("format", format);
if (translatedFormat != null && !translatedFormat.isEmpty()) {
formatInfo.format = translatedFormat;
formatInfo.formatCategory = profile.translateValue("format_category", format);
if (profile.hasTranslation("format_boost", format)) {
formatBoost = profile.translateValue("format_boost", format);
}
}
}
}
Expand Down

0 comments on commit dbe77f7

Please sign in to comment.