Skip to content

Commit

Permalink
Fix pending PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandre CREMIEUX authored and Alexandre CREMIEUX committed Jan 20, 2025
1 parent ea36f1a commit d7f9c2d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -434,10 +434,8 @@ private void searchForRelations(BibEntry entry, CheckListView<CitationRelationIt
listView.setItems(observableList);

// TODO: It should not be possible to cancel a search task that is already running for same tab
if (citingTask != null && !citingTask.isCancelled() && searchType == CitationFetcher.SearchType.CITES) {
if (!citingTask.isCancelled()) {
citingTask.cancel();
} else if (citedByTask != null && !citedByTask.isCancelled() && searchType == CitationFetcher.SearchType.CITED_BY) {
citedByTask.cancel();
}

this.createBackGroundTask(entry, searchType)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ public void insertCitations(BibEntry entry, List<BibEntry> citations) {

@Override
public List<BibEntry> readCitations(BibEntry entry) {
if (entry == null) {
return List.of();
}
return citationsDao.getRelations(entry);
}

Expand All @@ -56,6 +59,9 @@ public void insertReferences(BibEntry entry, List<BibEntry> references) {

@Override
public List<BibEntry> readReferences(BibEntry entry) {
if (entry == null) {
return List.of();
}
return referencesDao.getRelations(entry);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class MVStoreBibEntryRelationDAO implements BibEntryRelationDAO {

private static final Logger LOGGER = LoggerFactory.getLogger(MVStoreBibEntryRelationDAO.class);
private final static ZoneId TIME_STAMP_ZONE_ID = ZoneId.of("UTC");
private final static String TIME_STAMP_SUFFIX = "-insertion-timestamp";

private final String mapName;
private final String insertionTimeStampMapName;
Expand All @@ -52,8 +53,10 @@ public class MVStoreBibEntryRelationDAO implements BibEntryRelationDAO {
}

this.mapName = mapName;
this.insertionTimeStampMapName = mapName + "-insertion-timestamp";
this.storeConfiguration = new MVStore.Builder().autoCommitDisabled().fileName(path.toAbsolutePath().toString());
this.insertionTimeStampMapName = mapName + TIME_STAMP_SUFFIX;
this.storeConfiguration = new MVStore.Builder()
.autoCommitDisabled()
.fileName(path.toAbsolutePath().toString());
}

@Override
Expand Down

0 comments on commit d7f9c2d

Please sign in to comment.