Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

speculative fix for #388 #1

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/main/java/app/freerouting/api/v1/JobControllerV1.java
Original file line number Diff line number Diff line change
Expand Up @@ -361,10 +361,10 @@ public Response downloadOutput(
return Response.status(Response.Status.BAD_REQUEST).entity("{\"error\":\"The session ID '" + job.sessionId + "' is invalid.\"}").build();
}

// Check if the job is completed
if (job.state != RoutingJobState.COMPLETED)
{
return Response.status(Response.Status.BAD_REQUEST).entity("{\"error\":\"The job hasn't finished yet.\"}").build();
// Return current output if available, even if job isn't completed
if (job.output == null || job.output.getData() == null) {
return Response.status(Response.Status.NO_CONTENT)
.entity("{\"message\":\"No output available yet.\"}").build();
}

var result = new BoardFilePayload();
Expand Down Expand Up @@ -411,4 +411,4 @@ public Response logs(
FRAnalytics.apiEndpointCalled("GET v1/jobs/" + jobId + "/logs", "", response);
return Response.ok(response).build();
}
}
}
Loading