Remove TODO in MaxAgeCondition serialization (#52794)
* Remove TODO in MaxAgeCondition serialization This removes the TODO with a message for any future readers regarding the code in question. Resolves #52505
This commit is contained in:
parent
6669e53f08
commit
662f21fcea
|
@ -57,7 +57,12 @@ public class MaxAgeCondition extends Condition<TimeValue> {
|
|||
|
||||
@Override
|
||||
public void writeTo(StreamOutput out) throws IOException {
|
||||
//TODO here we should just use TimeValue#writeTo and same for de-serialization in the constructor, we lose information this way
|
||||
// While we technically could serialize this would out.writeTimeValue(...), that would
|
||||
// require doing the song and dance around backwards compatibility for this value. Since
|
||||
// in this case the deserialized version is not displayed to a user, it's okay to simply use
|
||||
// milliseconds. It's possible to lose precision if someone were to say, specify 50
|
||||
// nanoseconds, however, in that case, their max age is indistinguishable from 0
|
||||
// milliseconds regardless.
|
||||
out.writeLong(value.getMillis());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue