mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-12-13 16:46:59 +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
|
||||
default void updateElasticSearchFailureStatus(String failedFor, String failureMessage) {
|
||||
try {
|
||||
long updateTime = Date.from(LocalDateTime.now().atZone(ZoneId.systemDefault()).toInstant()).getTime();
|
||||
String recordString =
|
||||
getDao()
|
||||
@ -278,5 +279,8 @@ public interface SearchClient {
|
||||
ELASTIC_SEARCH_EXTENSION,
|
||||
JsonUtils.pojoToJson(lastRecord),
|
||||
originalLastUpdate);
|
||||
} catch (Exception e) {
|
||||
// Failure to update
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -211,6 +211,7 @@ public class ElasticSearchClientImpl implements SearchClient {
|
||||
LOG.info("{} Updated {}", elasticSearchIndexType.indexName, putMappingResponse.isAcknowledged());
|
||||
} else {
|
||||
CreateIndexRequest request = new CreateIndexRequest(elasticSearchIndexType.indexName);
|
||||
request.source(elasticSearchIndexMapping, XContentType.JSON);
|
||||
CreateIndexResponse createIndexResponse = client.indices().create(request, RequestOptions.DEFAULT);
|
||||
LOG.info("{} Created {}", elasticSearchIndexType.indexName, createIndexResponse.isAcknowledged());
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user