Skip to content

Commit

Permalink
Task cancellation API version guard fix (opensearch-project#7712)
Browse files Browse the repository at this point in the history
Signed-off-by: Sagar Upadhyaya <[email protected]>
  • Loading branch information
sgup432 authored and stephen-crawford committed May 31, 2023
1 parent 1fb6015 commit 96e44f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/src/main/java/org/opensearch/tasks/TaskInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public TaskInfo(StreamInput in) throws IOException {
} else {
resourceStats = null;
}
if (in.getVersion().onOrAfter(Version.V_3_0_0)) {
if (in.getVersion().onOrAfter(Version.V_2_8_0)) {
cancellationStartTime = in.readOptionalLong();
} else {
cancellationStartTime = null;
Expand All @@ -210,7 +210,7 @@ public void writeTo(StreamOutput out) throws IOException {
if (out.getVersion().onOrAfter(Version.V_2_1_0)) {
out.writeOptionalWriteable(resourceStats);
}
if (out.getVersion().onOrAfter(Version.V_3_0_0)) {
if (out.getVersion().onOrAfter(Version.V_2_8_0)) {
out.writeOptionalLong(cancellationStartTime);
}
}
Expand Down

0 comments on commit 96e44f0

Please sign in to comment.