Skip to content

Commit

Permalink
synchronized vocabularies loading improved
Browse files Browse the repository at this point in the history
  • Loading branch information
SrdjanStevanetic committed Apr 23, 2024
1 parent 90008c6 commit 9d4d0c7
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ public class VocabularyRepository {
private List<Vocabulary> europeanaRoles;

public List<Vocabulary> getEuropeanaRoles() {
if(europeanaRoles==null) {
synchronized(this) {
synchronized(this) {
if(europeanaRoles==null) {
europeanaRoles=new ArrayList<>();
europeanaRoles.addAll(
datastore.find(Vocabulary.class)
.iterator()
.toList());
}
return europeanaRoles;
}
return europeanaRoles;
}

/**
Expand Down

0 comments on commit 9d4d0c7

Please sign in to comment.