Skip to content

Commit

Permalink
ALS-7810: Fix dictionary config
Browse files Browse the repository at this point in the history
  • Loading branch information
ramari16 committed Nov 19, 2024
1 parent 25710e5 commit da8df75
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
package edu.harvard.hms.dbmi.avillach.hpds.processing.dictionary;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpMethod;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

import java.util.List;

@Component
@Service
@ConditionalOnProperty("dictionary.host")
public class DictionaryService {

Expand All @@ -19,8 +21,13 @@ public class DictionaryService {
private final String dictionaryHost;
private final RestTemplate restTemplate;

public DictionaryService(@Value("${dictionary.host}") String dictionaryHostTemplate, @Value("${TARGET_STACK}") String targetStack) {
this.dictionaryHost = dictionaryHostTemplate.replace("___TARGET_STACK___", targetStack);
@Autowired
public DictionaryService(@Value("${dictionary.host}") String dictionaryHostTemplate, @Value("${TARGET_STACK:}") String targetStack) {
if (targetStack != null && !targetStack.isEmpty()) {
this.dictionaryHost = dictionaryHostTemplate.replace("___TARGET_STACK___", targetStack);
} else {
this.dictionaryHost = dictionaryHostTemplate;
}
this.restTemplate = new RestTemplate();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ SMALL_JOB_LIMIT = 100
SMALL_TASK_THREADS = 1
LARGE_TASK_THREADS = 1

hpds.genomicProcessor.impl=localDistributed
HPDS_GENOMIC_DATA_DIRECTORY=/opt/local/hpds/all/
dictionary.host = http://wildfly.___TARGET_STACK___:8080/

0 comments on commit da8df75

Please sign in to comment.