From 64dbbd29c3978082a815adf9fd5ecd0dffea291d Mon Sep 17 00:00:00 2001 From: Bhavana Ramaram Date: Tue, 23 Jul 2024 16:03:59 -0500 Subject: [PATCH] change last_update_time field Signed-off-by: Bhavana Ramaram --- common/src/main/java/org/opensearch/ml/common/MLConfig.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/org/opensearch/ml/common/MLConfig.java b/common/src/main/java/org/opensearch/ml/common/MLConfig.java index f03226335a..bbcbb4aee1 100644 --- a/common/src/main/java/org/opensearch/ml/common/MLConfig.java +++ b/common/src/main/java/org/opensearch/ml/common/MLConfig.java @@ -111,6 +111,7 @@ public static MLConfig parse(XContentParser parser) throws IOException { Configuration mlConfiguration = null; Instant createTime = null; Instant lastUpdateTime = null; + Instant lastUpdatedTime = null; ensureExpectedToken(XContentParser.Token.START_OBJECT, parser.currentToken(), parser); while (parser.nextToken() != XContentParser.Token.END_OBJECT) { @@ -136,6 +137,9 @@ public static MLConfig parse(XContentParser parser) throws IOException { case LAST_UPDATE_TIME_FIELD: lastUpdateTime = Instant.ofEpochMilli(parser.longValue()); break; + case LAST_UPDATED_TIME_FIELD: + lastUpdatedTime = Instant.ofEpochMilli(parser.longValue()); + break; default: parser.skipChildren(); break; @@ -145,7 +149,7 @@ public static MLConfig parse(XContentParser parser) throws IOException { .type(configType == null ? type : configType) .configuration(mlConfiguration == null ? configuration : mlConfiguration) .createTime(createTime) - .lastUpdateTime(lastUpdateTime) + .lastUpdateTime(lastUpdatedTime == null ? lastUpdateTime : lastUpdatedTime) .build(); } }