mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-12-14 09:05:58 +00:00
Missing try catch for es-migrate option
This commit is contained in:
parent
a96b3ab5b4
commit
f51781c32d
@ -254,6 +254,7 @@ public interface SearchClient {
|
|||||||
|
|
||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
default void updateElasticSearchFailureStatus(String failedFor, String failureMessage) {
|
default void updateElasticSearchFailureStatus(String failedFor, String failureMessage) {
|
||||||
|
try {
|
||||||
long updateTime = Date.from(LocalDateTime.now().atZone(ZoneId.systemDefault()).toInstant()).getTime();
|
long updateTime = Date.from(LocalDateTime.now().atZone(ZoneId.systemDefault()).toInstant()).getTime();
|
||||||
String recordString =
|
String recordString =
|
||||||
getDao()
|
getDao()
|
||||||
@ -278,5 +279,8 @@ public interface SearchClient {
|
|||||||
ELASTIC_SEARCH_EXTENSION,
|
ELASTIC_SEARCH_EXTENSION,
|
||||||
JsonUtils.pojoToJson(lastRecord),
|
JsonUtils.pojoToJson(lastRecord),
|
||||||
originalLastUpdate);
|
originalLastUpdate);
|
||||||
|
} catch (Exception e) {
|
||||||
|
// Failure to update
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -211,6 +211,7 @@ public class ElasticSearchClientImpl implements SearchClient {
|
|||||||
LOG.info("{} Updated {}", elasticSearchIndexType.indexName, putMappingResponse.isAcknowledged());
|
LOG.info("{} Updated {}", elasticSearchIndexType.indexName, putMappingResponse.isAcknowledged());
|
||||||
} else {
|
} else {
|
||||||
CreateIndexRequest request = new CreateIndexRequest(elasticSearchIndexType.indexName);
|
CreateIndexRequest request = new CreateIndexRequest(elasticSearchIndexType.indexName);
|
||||||
|
request.source(elasticSearchIndexMapping, XContentType.JSON);
|
||||||
CreateIndexResponse createIndexResponse = client.indices().create(request, RequestOptions.DEFAULT);
|
CreateIndexResponse createIndexResponse = client.indices().create(request, RequestOptions.DEFAULT);
|
||||||
LOG.info("{} Created {}", elasticSearchIndexType.indexName, createIndexResponse.isAcknowledged());
|
LOG.info("{} Created {}", elasticSearchIndexType.indexName, createIndexResponse.isAcknowledged());
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user