Skip to content

Commit

Permalink
Ensure CU released, handle oddly degenerate CU props file
Browse files Browse the repository at this point in the history
  • Loading branch information
tlipkis committed May 5, 2020
1 parent fdcf81b commit b18aeb2
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 26 deletions.
26 changes: 15 additions & 11 deletions src/org/lockss/servlet/ViewContent.java
Original file line number Diff line number Diff line change
Expand Up @@ -301,18 +301,22 @@ void displaySummary(boolean contentInOtherFrame,
}

CachedUrl cu = au.makeCachedUrl(url);
if (cu.hasContent()) {
if (au.getLinkExtractor(cu.getContentType()) != null) {
tbl.newRow();
tbl.newCell("align=left");
Link extrlnk =
new Link(srvURL(AdminServletManager.SERVLET_LIST_OBJECTS,
PropUtil.fromArgs("type", "extracturls",
"auid", au.getAuId(),
"url", url)),
"Extract URLs");
tbl.add(extrlnk);
try {
if (cu.hasContent()) {
if (au.getLinkExtractor(cu.getContentType()) != null) {
tbl.newRow();
tbl.newCell("align=left");
Link extrlnk =
new Link(srvURL(AdminServletManager.SERVLET_LIST_OBJECTS,
PropUtil.fromArgs("type", "extracturls",
"auid", au.getAuId(),
"url", url)),
"Extract URLs");
tbl.add(extrlnk);
}
}
} finally {
AuUtil.safeRelease(cu);
}

page.add(tbl);
Expand Down
37 changes: 22 additions & 15 deletions src/org/lockss/state/ArchivalUnitStatus.java
Original file line number Diff line number Diff line change
Expand Up @@ -1610,19 +1610,23 @@ private List getRows(StatusTable table, ArchivalUnit au, String url)
int curRow = -1;
int curVer = curCu.getVersion() + 1;
for (CachedUrl cu : cuVersions) {
curRow++;
curVer--;
if (curRow < startRow) {
continue;
}
if (curRow >= endRow1) {
// add 'next'
rowL.add(makeOtherRowsLink(true, endRow1, au.getAuId(), url));
break;
try {
curRow++;
curVer--;
if (curRow < startRow) {
continue;
}
if (curRow >= endRow1) {
// add 'next'
rowL.add(makeOtherRowsLink(true, endRow1, au.getAuId(), url));
break;
}
Map row = makeRow(au, cu, curVer);
row.put("sort", curRow);
rowL.add(row);
} finally {
AuUtil.safeRelease(cu);
}
Map row = makeRow(au, cu, curVer);
row.put("sort", curRow);
rowL.add(row);
}
return rowL;
} finally {
Expand All @@ -1644,9 +1648,12 @@ private Map makeRow(ArchivalUnit au, CachedUrl cu, int ver) {
rowMap.put("Version", val);
rowMap.put("Size", cu.getContentSize());
Properties cuProps = cu.getProperties();
long collected =
Long.parseLong(cuProps.getProperty(CachedUrl.PROPERTY_FETCH_TIME));
rowMap.put("DateCollected", collected);
try {
long collected =
Long.parseLong(cuProps.getProperty(CachedUrl.PROPERTY_FETCH_TIME));
rowMap.put("DateCollected", collected);
} catch (NumberFormatException ignore) {
}
return rowMap;
}

Expand Down

0 comments on commit b18aeb2

Please sign in to comment.