mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-07 13:38:49 +00:00
don't (re) create a string from a numeric timestamp, just return the string we get
This commit is contained in:
parent
29d6b0e30a
commit
5517df6353
@ -655,7 +655,7 @@ public class IndexRequest extends ShardReplicationOperationRequest {
|
||||
|
||||
// generate timestamp if not provided, we always have one post this stage...
|
||||
if (timestamp == null) {
|
||||
timestamp = String.valueOf(System.currentTimeMillis());
|
||||
timestamp = Long.toString(System.currentTimeMillis());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -160,7 +160,9 @@ public class MappingMetaData {
|
||||
public static String parseStringTimestamp(String timestampAsString, FormatDateTimeFormatter dateTimeFormatter) throws TimestampParsingException {
|
||||
long ts;
|
||||
try {
|
||||
// if we manage to parse it, its a millisecond timestamp, just return the string as is
|
||||
ts = Long.parseLong(timestampAsString);
|
||||
return timestampAsString;
|
||||
} catch (NumberFormatException e) {
|
||||
try {
|
||||
ts = dateTimeFormatter.parser().parseMillis(timestampAsString);
|
||||
@ -168,7 +170,7 @@ public class MappingMetaData {
|
||||
throw new TimestampParsingException(timestampAsString);
|
||||
}
|
||||
}
|
||||
return String.valueOf(ts);
|
||||
return Long.toString(ts);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user