Skip to content

Commit 91b60a2

Browse files
author
Jorgen-5
committed
Fix sonar issue
1 parent 9f82c31 commit 91b60a2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

klass-api/src/main/java/no/ssb/klass/api/services/IndexServiceImpl.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,16 @@ public class IndexServiceImpl implements IndexService {
5858
private final ClassificationSeriesRepository classificationRepository;
5959
private final OpenSearchRestTemplate elasticsearchOperations;
6060
private final DocumentMapper documentMapper;
61+
private final IndexService self;
6162

6263
@Autowired
6364
public IndexServiceImpl(
6465
ClassificationSeriesRepository classificationRepository,
65-
OpenSearchRestTemplate elasticsearchOperations) {
66+
OpenSearchRestTemplate elasticsearchOperations,IndexService self) {
6667
this.classificationRepository = classificationRepository;
6768
this.elasticsearchOperations = elasticsearchOperations;
6869
this.documentMapper = new DocumentMapper();
70+
this.self = self;
6971
}
7072

7173
private IndexCoordinates getIndexCoordinates() {
@@ -160,7 +162,7 @@ public void indexAsync(Long classificationSeriesId) {
160162
try {
161163
ClassificationSeries classification =
162164
classificationRepository.getOne(classificationSeriesId);
163-
indexSync(classification);
165+
self.indexSync(classification);
164166
} catch (Exception e) {
165167
log.warn(
166168
"Failed to index classification {}: {}",

0 commit comments

Comments
 (0)