Skip to content

Commit

Permalink
sync map based on review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
alessandrobenedetti committed Nov 18, 2024
1 parent 216180c commit 4589687
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ public class EmbeddingModelStore {
private final Map<String, SolrEmbeddingModel> availableModels;

public EmbeddingModelStore() {
availableModels = new LinkedHashMap<>();
availableModels = Collections.synchronizedMap(new LinkedHashMap<>());
}

public synchronized SolrEmbeddingModel getModel(String name) {
public SolrEmbeddingModel getModel(String name) {
return availableModels.get(name);
}

Expand All @@ -54,7 +54,7 @@ public SolrEmbeddingModel delete(String modelName) {
return availableModels.remove(modelName);
}

public synchronized void addModel(SolrEmbeddingModel modeldata) throws EmbeddingModelException {
public void addModel(SolrEmbeddingModel modeldata) throws EmbeddingModelException {
final String name = modeldata.getName();
if (availableModels.containsKey(name)) {
throw new EmbeddingModelException(
Expand Down

0 comments on commit 4589687

Please sign in to comment.